SapionAps / ParaTos

Userspace Tos (and MiNT) emulator for Linux.
GNU General Public License v3.0
9 stars 0 forks source link

build fails #1

Open ragnar76 opened 11 months ago

ragnar76 commented 11 months ago

Hi there,

i went into some trouble building ParaTos. Output of GCC down below. I'm using Linux Mint 21.2 and gcc-12 (along with make, cmake, autoconf, automake and the other funky stuff)


ragnar@tower:~/src/ATARI/ParaTos/build$ make
[  3%] Building C object gemdos/CMakeFiles/gemdos.dir/cdev.c.o
[  6%] Building C object gemdos/CMakeFiles/gemdos.dir/date.c.o
[ 10%] Building C object gemdos/CMakeFiles/gemdos.dir/dir.c.o
[ 13%] Building C object gemdos/CMakeFiles/gemdos.dir/file.c.o
[ 17%] Building C object gemdos/CMakeFiles/gemdos.dir/mem.c.o
[ 20%] Building C object gemdos/CMakeFiles/gemdos.dir/net.c.o
[ 24%] Building C object gemdos/CMakeFiles/gemdos.dir/path.c.o
[ 27%] Building C object gemdos/CMakeFiles/gemdos.dir/pexec.c.o
[ 31%] Building C object gemdos/CMakeFiles/gemdos.dir/proc.c.o
[ 34%] Building C object gemdos/CMakeFiles/gemdos.dir/signals.c.o
[ 37%] Building C object gemdos/CMakeFiles/gemdos.dir/sys.c.o
[ 41%] Building C object gemdos/CMakeFiles/gemdos.dir/loader.c.o
[ 44%] Building C object gemdos/CMakeFiles/gemdos.dir/gemdos_dispatch.c.o
[ 48%] Building C object gemdos/CMakeFiles/gemdos.dir/cookiejar.c.o
[ 51%] Linking C static library libgemdos.a
[ 51%] Built target gemdos
[ 55%] Building C object mushashi/CMakeFiles/m68kmake.dir/m68kmake.c.o
/home/ragnar/src/ATARI/ParaTos/mushashi/m68kmake.c: In function ‘main’:
/home/ragnar/src/ATARI/ParaTos/mushashi/m68kmake.c:1261:30: warning: ‘%s’ directive writing 9 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
 1261 |         sprintf(filename, "%s%s", output_path, FILENAME_PROTOTYPE);
      |                              ^~
/home/ragnar/src/ATARI/ParaTos/mushashi/m68kmake.c:1261:9: note: ‘sprintf’ output between 10 and 1033 bytes into a destination of size 1024
 1261 |         sprintf(filename, "%s%s", output_path, FILENAME_PROTOTYPE);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ragnar/src/ATARI/ParaTos/mushashi/m68kmake.c:1265:30: warning: ‘%s’ directive writing 9 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
 1265 |         sprintf(filename, "%s%s", output_path, FILENAME_TABLE);
      |                              ^~
/home/ragnar/src/ATARI/ParaTos/mushashi/m68kmake.c:1265:9: note: ‘sprintf’ output between 10 and 1033 bytes into a destination of size 1024
 1265 |         sprintf(filename, "%s%s", output_path, FILENAME_TABLE);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ragnar/src/ATARI/ParaTos/mushashi/m68kmake.c:1269:30: warning: ‘%s’ directive writing 10 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
 1269 |         sprintf(filename, "%s%s", output_path, FILENAME_OPS_AC);
      |                              ^~
/home/ragnar/src/ATARI/ParaTos/mushashi/m68kmake.c:1269:9: note: ‘sprintf’ output between 11 and 1034 bytes into a destination of size 1024
 1269 |         sprintf(filename, "%s%s", output_path, FILENAME_OPS_AC);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ragnar/src/ATARI/ParaTos/mushashi/m68kmake.c:1273:30: warning: ‘%s’ directive writing 10 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
 1273 |         sprintf(filename, "%s%s", output_path, FILENAME_OPS_DM);
      |                              ^~
/home/ragnar/src/ATARI/ParaTos/mushashi/m68kmake.c:1273:9: note: ‘sprintf’ output between 11 and 1034 bytes into a destination of size 1024
 1273 |         sprintf(filename, "%s%s", output_path, FILENAME_OPS_DM);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ragnar/src/ATARI/ParaTos/mushashi/m68kmake.c:1277:30: warning: ‘%s’ directive writing 10 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
 1277 |         sprintf(filename, "%s%s", output_path, FILENAME_OPS_NZ);
      |                              ^~
/home/ragnar/src/ATARI/ParaTos/mushashi/m68kmake.c:1277:9: note: ‘sprintf’ output between 11 and 1034 bytes into a destination of size 1024
 1277 |         sprintf(filename, "%s%s", output_path, FILENAME_OPS_NZ);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 58%] Linking C executable m68kmake
[ 58%] Built target m68kmake
[ 62%] Generating m68kops.c, m68kopnz.c, m68kopdm.c, m68kopac.c

        Musashi v3.3 68000, 68010, 68EC020, 68020 emulator
        Copyright 1998-2000 Karl Stenerud (karl@mame.net)

Generated 1962 opcode handlers from 513 primitives
[ 65%] Building C object mushashi/CMakeFiles/mushashi.dir/m68kcpu.c.o
[ 68%] Building C object mushashi/CMakeFiles/mushashi.dir/m68kdasm.c.o
[ 72%] Building C object mushashi/CMakeFiles/mushashi.dir/m68kops.c.o
[ 75%] Building C object mushashi/CMakeFiles/mushashi.dir/m68kopnz.c.o
[ 79%] Building C object mushashi/CMakeFiles/mushashi.dir/m68kopdm.c.o
[ 82%] Building C object mushashi/CMakeFiles/mushashi.dir/m68kopac.c.o
[ 86%] Linking C static library libmushashi.a
[ 86%] Built target mushashi
[ 89%] Building C object CMakeFiles/paratos.dir/paratos.c.o
[ 93%] Building C object CMakeFiles/paratos.dir/memory.c.o
[ 96%] Building C object CMakeFiles/paratos.dir/tos_errors.c.o
[100%] Linking C executable paratos
/usr/bin/ld: gemdos/libgemdos.a(loader.c.o):(.bss+0x0): multiple definition of `__'; CMakeFiles/paratos.dir/paratos.c.o:(.bss+0x0): first defined here
/usr/bin/ld: gemdos/libgemdos.a(gemdos_dispatch.c.o):(.bss+0x0): multiple definition of `__'; CMakeFiles/paratos.dir/paratos.c.o:(.bss+0x0): first defined here
/usr/bin/ld: gemdos/libgemdos.a(cookiejar.c.o):(.bss+0x0): multiple definition of `__'; CMakeFiles/paratos.dir/paratos.c.o:(.bss+0x0): first defined here
/usr/bin/ld: gemdos/libgemdos.a(dir.c.o):(.bss+0x0): multiple definition of `__'; CMakeFiles/paratos.dir/paratos.c.o:(.bss+0x0): first defined here
/usr/bin/ld: gemdos/libgemdos.a(file.c.o):(.bss+0x0): multiple definition of `__'; CMakeFiles/paratos.dir/paratos.c.o:(.bss+0x0): first defined here
/usr/bin/ld: gemdos/libgemdos.a(path.c.o):(.bss+0x0): multiple definition of `__'; CMakeFiles/paratos.dir/paratos.c.o:(.bss+0x0): first defined here
/usr/bin/ld: gemdos/libgemdos.a(pexec.c.o):(.bss+0x0): multiple definition of `__'; CMakeFiles/paratos.dir/paratos.c.o:(.bss+0x0): first defined here
/usr/bin/ld: gemdos/libgemdos.a(proc.c.o):(.bss+0x0): multiple definition of `__'; CMakeFiles/paratos.dir/paratos.c.o:(.bss+0x0): first defined here
/usr/bin/ld: gemdos/libgemdos.a(signals.c.o):(.bss+0x0): multiple definition of `__'; CMakeFiles/paratos.dir/paratos.c.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/paratos.dir/build.make:131: paratos] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:121: CMakeFiles/paratos.dir/all] Fehler 2
make: *** [Makefile:91: all] Fehler 2
kelihlodversson commented 9 months ago

Looks like some header include defines a global called _ or and later gnu C versions default to -fno-common which will not convert symbols like that to weak symbols and allow merging them.

Have you tried changing the compiler options to add -fcommon to work around the problem? (You can do it by adding -DCMAKE_C_FLAGS=-fcommon when running cmake.)

Atari260STE commented 7 months ago

I had the same issue and "cmake .. -DCMAKE_C_FLAGS=-fcommon" did the job