lronaldo / cpctelera

Astonishingly fast Amstrad CPC game engine for C developers
http://lronaldo.github.io/cpctelera/
GNU Lesser General Public License v3.0
229 stars 54 forks source link

Cannot compile with Archlinux/gcc 10.1.0 #111

Closed kamelie1706 closed 4 years ago

kamelie1706 commented 4 years ago

Hi,

setup.sh

Welcome to...
 ____     ____     ____     __            ___
/\  _`\  /\  _`\  /\  _`\  /\ \__        /\_ \
\ \ \/\_\\ \ \L\ \\ \ \/\_\\ \ ,_\     __\//\ \       __   _ __    __
 \ \ \/_/_\ \ ,__/ \ \ \/_/_\ \ \/   /'__`\\ \ \    /'__`\/\`'__\/'__`\
  \ \ \L\ \\ \ \/   \ \ \L\ \\ \ \_ /\  __/ \_\ \_ /\  __/\ \ \//\ \L\.\_
   \ \____/ \ \_\    \ \____/ \ \__\\ \____\/\____\\ \____\\ \_\\ \__/.\_\
    \/___/   \/_/     \/___/   \/__/ \/____/\/____/ \/____/ \/_/ \/__/\/_/

This setup script will help you configure CPCtelera in your system.

===============================================================
== 1: CPCtelera initial tests
===============================================================
> Checking directory structure... [ OK ]
> Checking important files....... [ OK ]
> Checking required commands...
>>> Looking for 'gcc'... [ OK ]
>>> Looking for 'g++'... [ OK ]
>>> Looking for 'make'... [ OK ]
>>> Looking for 'bison'... [ OK ]
>>> Looking for 'flex'... [ OK ]
>>> Looking for 'mono'... [ OK ]
> Checking command versions...
>>> GNU GCC/G++ Version >= 4.6...

#########################
## UNRECOVERABLE ERROR ##
#########################
##> CPCtelera requires GCC 4.6 or greater. Please, update    your GCC version and run setup again.

Strange! Disable the check and add english env (export LC_ALL=C) ... now fails to build the tools

make: Entering directory '/home/cyril/AUR/cpctelera/cpctelera/tools'
[ToolMaker] Building  2cdt...
make[1]: Entering directory '/home/cyril/AUR/cpctelera/cpctelera/tools/2cdt'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/cyril/AUR/cpctelera/cpctelera/tools/2cdt'
[ToolMaker] Building  hex2bin-2.0...
make[1]: Entering directory '/home/cyril/AUR/cpctelera/cpctelera/tools/hex2bin-2.0'
gcc -std=gnu99 -O3 -fsigned-char -Wall -pedantic -o bin/hex2bin  obj/hex2bin.o  obj/common.o  obj/libcrc.o  obj/binary.o
/usr/bin/ld: obj/common.o:(.data+0x8): multiple definition of `Pad_Byte'; obj/hex2bin.o:(.bss+0x78): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x78): multiple definition of `Filin'; obj/hex2bin.o:(.bss+0x88): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x70): multiple definition of `Filout'; obj/hex2bin.o:(.bss+0x80): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x64): multiple definition of `Checksum'; obj/hex2bin.o:(.bss+0x6c): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x6c): multiple definition of `Enable_Checksum_Error'; obj/hex2bin.o:(.bss+0x74): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x60): multiple definition of `Record_Nb'; obj/hex2bin.o:(.bss+0x68): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x68): multiple definition of `Status_Checksum_Error'; obj/hex2bin.o:(.bss+0x70): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x2c): multiple definition of `Cks_Type'; obj/hex2bin.o:(.bss+0x30): first defined here
/usr/bin/ld: obj/common.o:(.data+0x0): multiple definition of `Crc_Poly'; obj/hex2bin.o:(.bss+0x10): first defined here
/usr/bin/ld: obj/common.o:(.bss+0xc): multiple definition of `Crc_Init'; obj/hex2bin.o:(.bss+0xc): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x8): multiple definition of `Crc_XorOut'; obj/hex2bin.o:(.bss+0x8): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x20): multiple definition of `Cks_Addr'; obj/hex2bin.o:(.bss+0x24): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x54): multiple definition of `Lowest_Address'; obj/hex2bin.o:(.bss+0x5c): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x30): multiple definition of `Endian'; obj/hex2bin.o:(.bss+0x34): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x58): multiple definition of `Memory_Block'; obj/hex2bin.o:(.bss+0x60): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x50): multiple definition of `Highest_Address'; obj/hex2bin.o:(.bss+0x58): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x10): multiple definition of `Force_Value'; obj/hex2bin.o:(.bss+0x14): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x48): multiple definition of `Max_Length'; obj/hex2bin.o:(.bss+0x50): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x40): multiple definition of `Minimum_Block_Size_Setted'; obj/hex2bin.o:(.bss+0x44): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x14): multiple definition of `Cks_Addr_set'; obj/hex2bin.o:(.bss+0x18): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x18): multiple definition of `Cks_range_set'; obj/hex2bin.o:(.bss+0x1c): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x28): multiple definition of `Cks_Start'; obj/hex2bin.o:(.bss+0x2c): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x24): multiple definition of `Cks_End'; obj/hex2bin.o:(.bss+0x28): first defined here
/usr/bin/ld: obj/common.o:(.data+0x4): multiple definition of `Minimum_Block_Size'; obj/hex2bin.o:(.bss+0x4c): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x44): multiple definition of `Module'; obj/hex2bin.o:(.bss+0x48): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x38): multiple definition of `Max_Length_Setted'; obj/hex2bin.o:(.bss+0x3c): first defined here
/usr/bin/ld: obj/common.o:(.bss+0xf8): multiple definition of `crc_table'; obj/hex2bin.o:(.bss+0xf8): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x1c): multiple definition of `Cks_Value'; obj/hex2bin.o:(.bss+0x20): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x4): multiple definition of `Crc_RefIn'; obj/hex2bin.o:(.bss+0x4): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x0): multiple definition of `Crc_RefOut'; obj/hex2bin.o:(.bss+0x0): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x34): multiple definition of `Swap_Wordwise'; obj/hex2bin.o:(.bss+0x38): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x3c): multiple definition of `Starting_Address_Setted'; obj/hex2bin.o:(.bss+0x40): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x4c): multiple definition of `Starting_Address'; obj/hex2bin.o:(.bss+0x54): first defined here
/usr/bin/ld: obj/common.o:(.bss+0x80): multiple definition of `Extension'; obj/hex2bin.o:(.bss+0x90): first defined here
/usr/bin/ld: obj/common.o:(.bss+0xa0): multiple definition of `Filename'; obj/hex2bin.o:(.bss+0xa0): first defined here
/usr/bin/ld: obj/libcrc.o:(.bss+0x0): multiple definition of `crc_table'; obj/hex2bin.o:(.bss+0xf8): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:33: bin/hex2bin] Error 1
make[1]: Leaving directory '/home/cyril/AUR/cpctelera/cpctelera/tools/hex2bin-2.0'
make: *** [Makefile:74: hex2bin-2.0] Error 2
make: Leaving directory '/home/cyril/AUR/cpctelera/cpctelera/tools'

Thx

lronaldo commented 4 years ago

Hi @kamelie1706 ,

The check fails because GCC moved to two digits, and bash is somewhat special treating numbers. I will change that check to work well with 2 digit version numbers.

It doesn't make any sense the error you are reporting on building hex2bin. It seems that it was built previously, as OBJs are not being rebuilt. Could you please execute setup.sh -cri to make a clean rebuild and check if the error happens again?

Thank you for reporting.

lronaldo commented 4 years ago

After having a look at it, it seems that these errors are actually errors that previous versions of GCC didn't report as errors. Therefore, hex2bin build is actually broken, and has been since its start. I'm fixing it.

lronaldo commented 4 years ago

I've uploaded a simple change that makes it work again. Previous versions of GCC had implicit -fcommon flag which permitted common declaration of global variables on multiple translation units. GCC 10 has changed this default setting to -fno-common which is way more sensible, but that has triggered these errors. Just adding -fcommon to both builds makes them back to their original status.

Everything should work now with respect to setup.sh with GCC 10. @kamelie1706 , if you could test it and report new status, that would be much appreciated.

kamelie1706 commented 4 years ago

THx, it worked. Strange thing is git clone did not get me the latest version even if deleted the whole directory....

anyway change the line manually and it worked

lronaldo commented 4 years ago

Did you use CPCtelera 1.4.2 stable from master branch, or CPCtelera 1.5 WIP from development branch?

kamelie1706 commented 4 years ago

Did you use CPCtelera 1.4.2 stable from master branch, or CPCtelera 1.5 WIP from development branch?

My bad I was indeed on the stable branch!

Gracias

lronaldo commented 4 years ago

That's not a problem. On the contrary: I have also updated master branch because this is a bug and stable branch needed to be updated. Only thing is that you should say it to know it in advance, just to prevent confusion ;)

Thanks to you for reporting and collaborating!