ColEm 5.6 build errors

42 views
Skip to first unread message

Ron Klein

unread,
Mar 4, 2025, 4:22:17 PMMar 4
to EMUL8
Hello,

Trying to build ColEm 5.6 from source on my Debian 12 workstation.  Running 'make' from the '$HOME/source/ColEm56/ColEm/Unix' folder and getting the following errors:

COLLECT_GCC_OPTIONS='-o' 'colem' '-O2' '-pthread' '-I' '.' '-I' '..' '-I' '../../EMULib' '-I' '../../EMULib/Unix' '-I' '/usr/X11R6/include' '-Wno-error' '-v' '-I' '../../Z80' '-mtune=generic' '-march=x86-64' '-dumpdir' 'colem.'
 /usr/lib/gcc/x86_64-linux-gnu/12/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/12/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper -plugin-opt=-fresolution=/tmp/ccQQVOpd.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o colem /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/12/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/12 -L/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/12/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/12/../../.. ../../EMULib/EMULib.o ../../EMULib/Sound.o ../../EMULib/Image.o ../../EMULib/Console.o ../../EMULib/Record.o ../../EMULib/NetPlay.o ../../EMULib/Touch.o ../../EMULib/Unix/LibUnix.o ../../EMULib/Unix/SndUnix.o ../../EMULib/Unix/NetUnix.o ../../Z80/Z80.o ../../Z80/ConDebug.o ../../EMULib/SN76489.o ../../EMULib/TMS9918.o ../../EMULib/DRV9918.o ../../EMULib/AY8910.o ../../EMULib/C24XX.o ../../EMULib/CRC32.o ../../EMULib/Hunt.o ../../EMULib/FDIDisk.o ../Coleco.o ../AdamNet.o ../ColEm.o ../Menu.o Unix.o -lz -lpthread -lX11 -lXext -lpulse-simple -lgcc --push-state --as-needed -lgcc_s --pop-state -lpthread -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/12/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crtn.o
/usr/bin/ld: ../../EMULib/Sound.o:(.bss+0x30): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../EMULib/Sound.o:(.bss+0x38): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../../EMULib/Image.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../EMULib/Image.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../../EMULib/Console.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../EMULib/Console.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../../EMULib/Record.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../EMULib/Record.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../../EMULib/NetPlay.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../EMULib/NetPlay.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../../EMULib/Touch.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../EMULib/Touch.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../../EMULib/Unix/LibUnix.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../../EMULib/Unix/LibUnix.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../EMULib/Unix/SndUnix.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../EMULib/Unix/SndUnix.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../../EMULib/Unix/NetUnix.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../EMULib/Unix/NetUnix.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../../Z80/ConDebug.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../Z80/ConDebug.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../../EMULib/SN76489.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../EMULib/SN76489.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../../EMULib/AY8910.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../../EMULib/AY8910.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../Coleco.o:(.bss+0x1668): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../Coleco.o:(.bss+0x1670): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../AdamNet.o:(.bss+0x10000): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../AdamNet.o:(.bss+0x10008): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../ColEm.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../ColEm.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: ../Menu.o:(.bss+0x0): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: ../Menu.o:(.bss+0x8): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
/usr/bin/ld: Unix.o:(.bss+0x68): multiple definition of `ARGV'; ../../EMULib/EMULib.o:(.bss+0x20): first defined here
/usr/bin/ld: Unix.o:(.bss+0x70): multiple definition of `ARGC'; ../../EMULib/EMULib.o:(.bss+0x28): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:14: colem] Error 1

Any help resolving this would be appreciated.  

Linux x570 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64 GNU/Linux
gcc (Debian 12.2.0-14) 12.2.0
ldd (Debian GLIBC 2.36-9+deb12u9) 2.36


Thank you!

fms

unread,
Mar 4, 2025, 4:32:59 PMMar 4
to EMUL8
Move ARGC/ARGV definitions from LibUnix.h to LibUnix.c. Make them "extern" delcarations in LibUnix.h. Sorry, I do not know how this happened.

Ron Klein

unread,
Mar 4, 2025, 5:16:27 PMMar 4
to EMUL8
OK, removed the definitions from LibUnix.h and added them to LibUnix.c as extern (here):

...
#define FPS_COLOR PIXEL(255,0,255)

extern int  ARGC;
extern char **ARGV;
extern int MasterSwitch; /* Switches to turn channels on/off */
extern int MasterVolume; /* Master volume                    */
...

Cleaned and ran 'make' again:

gcc -o colem -O2 -pthread -I. -I.. -I../../EMULib -I../../EMULib/Unix -I/usr/X11R6/include -Wall -I../../Z80 ../../EMULib/EMULib.o ../../EMULib/Sound.o ../../EMULib/Image.o  ../../EMULib/Console.o ../../EMULib/Record.o ../../EMULib/NetPlay.o ../../EMULib/Touch.o ../../EMULib/Unix/LibUnix.o ../../EMULib/Unix/SndUnix.o ../../EMULib/Unix/NetUnix.o ../../Z80/Z80.o ../../Z80/ConDebug.o ../../EMULib/SN76489.o ../../EMULib/TMS9918.o ../../EMULib/DRV9918.o ../../EMULib/AY8910.o ../../EMULib/C24XX.o ../../EMULib/CRC32.o ../../EMULib/Hunt.o ../../EMULib/FDIDisk.o ../Coleco.o ../AdamNet.o ../ColEm.o ../Menu.o Unix.o -lz -lpthread -lX11 -lXext -lpulse-simple
/usr/bin/ld: ../../EMULib/Unix/LibUnix.o: warning: relocation against `ARGC' in read-only section `.text'
/usr/bin/ld: ../../EMULib/Unix/LibUnix.o: in function `X11Window':
LibUnix.c:(.text+0x163b): undefined reference to `ARGC'
/usr/bin/ld: LibUnix.c:(.text+0x1646): undefined reference to `ARGV'
/usr/bin/ld: LibUnix.c:(.text+0x1688): undefined reference to `ARGV'
/usr/bin/ld: LibUnix.c:(.text+0x168e): undefined reference to `ARGC'
/usr/bin/ld: LibUnix.c:(.text+0x16a3): undefined reference to `ARGC'
/usr/bin/ld: LibUnix.c:(.text+0x1765): undefined reference to `ARGV'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE

collect2: error: ld returned 1 exit status
make: *** [Makefile:14: colem] Error 1

Looks like many of the previous errors were resolved but still have a few left.

Thank you for your quick response!

-Ron


fms

unread,
Mar 4, 2025, 5:17:16 PMMar 4
to EMUL8
On Tuesday, March 4, 2025 at 5:16:27 PM UTC-5 Ron Klein wrote:
OK, removed the definitions from LibUnix.h and added them to LibUnix.c as extern (here):
You are not doing what I have suggested to do.

Ron Klein

unread,
Mar 4, 2025, 5:32:25 PMMar 4
to EMUL8
Ok, fixed my mistake and it built correctly.

Thank you again for all of your help.

-Ron
Reply all
Reply to author
Forward
0 new messages