kubilus1 / gendev

Genesis development environment for Linux.
BSD 3-Clause "New" or "Revised" License
209 stars 23 forks source link

Build fails on Arch Linux x86_64 #29

Closed kivutar closed 7 years ago

kivutar commented 7 years ago

I cloned master and did a sudo make.

I'm getting this error:

Build
cd work && \
    MAKE=make make -f ../gen_gcc/makefile-gen build-m68k
make[1] : on entre dans le répertoire « /home/kivutar/gendev/work »
+++ Building binutils-2.24 to build-binutils-m68k-elf-2.24...
mkdir -p build-binutils-m68k-elf-2.24
> /home/kivutar/gendev/work/logs/build-binutils-m68k-elf-2.24.log
cd build-binutils-m68k-elf-2.24; ../binutils-2.24/configure --target=m68k-elf --prefix=/opt/toolchains/gen/m68k-elf --enable-install-libbfd --disable-werror >> /home/kivutar/gendev/work/logs/build-binutils-m68k-elf-2.24.log 2>&1
make -C build-binutils-m68k-elf-2.24 all install DESTDIR= >> /home/kivutar/gendev/work/logs/build-binutils-m68k-elf-2.24.log 2>&1
+++ Building gcc-6.3.0 to build-gcc-m68k-elf-6.3.0 (pass 1)...
mkdir -p build-gcc-m68k-elf-6.3.0
> /home/kivutar/gendev/work/logs/build-gcc-m68k-elf-6.3.0-pass1.log
cd build-gcc-m68k-elf-6.3.0;  ../gcc-6.3.0/configure --target=m68k-elf --prefix=/opt/toolchains/gen/m68k-elf --without-headers --with-newlib --enable-languages=c --disable-libssp --disable-tls --with-cpu=m68000 --disable-werror >> /home/kivutar/gendev/work/logs/build-gcc-m68k-elf-6.3.0-pass1.log 2>&1
make -C build-gcc-m68k-elf-6.3.0 all install DESTDIR= >> /home/kivutar/gendev/work/logs/build-gcc-m68k-elf-6.3.0-pass1.log 2>&1
make[1]: *** [../gen_gcc/makefile-gen:108: build-m68k-gcc-pass1] Error 2
make[1] : on quitte le répertoire « /home/kivutar/gendev/work »
make: *** [Makefile:54: toolchain_build] Error 2

In the log, I can see:

../../gcc-6.3.0/gcc/ubsan.c:1474:23: error: le C++ ISO interdit la comparaison entre un pointeur et un entier [-fpermissive]
kubilus1 commented 7 years ago

Not sure. I haven't tested this in Arch. What version of gcc do you have?

You could try to pull my latest changes to see if that makes any difference. I kind of doubt it though since this is built in a pretty standard way.

kivutar commented 7 years ago

I have gcc (GCC) 7.1.1 20170528

I still get this error with the latest master:

../../gcc-6.3.0/gcc/ubsan.c: Dans la fonction « bool ubsan_use_new_style_p(location_t) »:
../../gcc-6.3.0/gcc/ubsan.c:1474:23: error: le C++ ISO interdit la comparaison entre un pointeur et un entier [-fpermissive]
       || xloc.file == '\0' || xloc.file[0] == '\xff'
kubilus1 commented 7 years ago

Perhaps there are issues attempting to build GCC 6.3.0 with GCC 7.1.1. The GCC documentation may be of help: https://gcc.gnu.org/install/index.html

andwn commented 7 years ago

The 7.1 release notes don't mention -fpermissive so not sure what is going on there.

Unrelated but why is Arch packaging x.x.1 releases of GCC? Those are development snapshots. https://gcc.gnu.org/develop.html

kubilus1 commented 7 years ago

It's possible to perhaps try building the toolchain with a different GCC version. Grab the package, drop it into toolchain/files, and update the toolchain/Makefile GCC_VERSION var.

kivutar commented 7 years ago

We could apply this patch https://raw.githubusercontent.com/openembedded/openembedded-core/master/meta/recipes-devtools/gcc/gcc-6.3/ubsan-fix-check-empty-string.patch

ghost commented 7 years ago

I've had to apply that patch for a couple other toolchains, too.

v4ld3r5 commented 7 years ago

Hi, It happens also on Ubuntu 17.10:

danielv@ubuntu:~/gendev$ gcc --version
gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

danielv@ubuntu:~/gendev$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.10
DISTRIB_CODENAME=artful
DISTRIB_DESCRIPTION="Ubuntu 17.10"

Details on message:

../../gcc-6.3.0/gcc/ubsan.c: In function ‘bool ubsan_use_new_style_p(location_t)’:
../../gcc-6.3.0/gcc/ubsan.c:1474:23: error: ISO C++ forbids comparison between pointer and integer 

Best regards

kubilus1 commented 7 years ago

Should be resolved now.

v4ld3r5 commented 7 years ago

hi, It is compiling without trouble. Thank you. Too bad gcc team didn't rollout a minor-release fixing it themselves without going for 6.4.0

regards

kubilus1 commented 7 years ago

Thanks for verifying! Apologies for the super-slow turn around on this.