Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gcc-5.4.0 doesn't compile (inside and outside of chroot)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 2985
Location: de

PostPosted: Sun Aug 21, 2016 3:19 pm    Post subject: gcc-5.4.0 doesn't compile (inside and outside of chroot) Reply with quote

Grml, always new problems appear on my hard way to get the arm stuff running. Now gcc won't compile.

First of all my make.conf of the cross environment:
/usr/armv7a-hardfloat-linux-gnueabi/etc/portage/make.conf:

CFLAGS="-Ofast -march=armv7-a -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
ACCEPT_KEYWORDS="arm ~arm"
FEATURES="-collision-protect sandbox buildpkg noman noinfo nodoc"
USE="${ARCH} -pam -acl -avahi -consolekit -cracklib -cron -dso -dv -emboss -fam -firefox -gdbm -gnome -ipv6 -ldap -libav -libcanberra -modemmanager -pm-utils -pulseaudio -qt-static -vlc -kde"

CBUILD=x86_64-pc-linux-gnu
ARCH="arm"
HOSTCC=x86_64-pc-linux-gnu-gcc
ROOT=/usr/armv7a-hardfloat-linux-gnueabi/
CC=/usr/x86_64-pc-linux-gnu/armv7a-hardfloat-linux-gnueabi/gcc-bin/5.4.0/armv7a-hardfloat-linux-gnueabi-gcc
CXX=/usr/x86_64-pc-linux-gnu/armv7a-hardfloat-linux-gnueabi/gcc-bin/5.4.0/armv7a-hardfloat-linux-gnueabi-g++


If I start compiling gcc fails:
armv7a-hardfloat-linux-gnueabi-emerge -1u gcc (from outside chroot):
g++  -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp -I. -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/../include -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/include  -march=armv7-a -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard -pipe -O2 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp -I. -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/../include -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/include   -c -o expr.o -MT expr.o -MMD -MP -MF .deps/expr.Tpo /var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/expr.c
g++  -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp -I. -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/../include -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/include  -march=armv7-a -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard -pipe -O2 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp -I. -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/../include -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/include   -c -o files.o -MT files.o -MMD -MP -MF .deps/files.Tpo /var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/files.c
g++: error: unrecognized command line option ‘-mfpu=neon-fp16’
g++: error: unrecognized command line option ‘-mfloat-abi=hard’
make[2]: *** [Makefile:224: charset.o] Error 1
make[2]: *** Waiting for unfinished jobs....


Do I drop both flags, gcc complains about the next options:
armv7a-hardfloat-linux-gnueabi-emerge -1u gcc:
g++  -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp -I. -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/../include -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/include  -march=armv7-a -mtune=cortex-a9 -pipe -O2 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp -I. -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/../include -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/include   -c -o files.o -MT files.o -MMD -MP -MF .deps/files.Tpo /var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/files.c
gcc -c  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long   -DHAVE_CONFIG_H -I. -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/fixincludes -I../include -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/fixincludes/../include /var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/fixincludes/procopen.c
checking for times... /var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/charset.c:1:0: error: bad value (armv7-a) for -march= switch
 /* CPP Library - charsets
 ^
/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/charset.c:1:0: error: bad value (cortex-a9) for -mtune= switch
make[2]: *** [Makefile:224: charset.o] Error 1
make[2]: *** Waiting for unfinished jobs....
gcc -c  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long   -DHAVE_CONFIG_H -I. -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/fixincludes -I../include -I/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/fixincludes/../include /var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/fixincludes/fixlib.c
/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libcpp/directives.c:1:0: error: bad value (armv7-a) for -march= switch
 /* CPP Library. (Directive handling.)

Obviously the cross-compiler doesn't know the arm parameters, when compiling gcc. Other packages (ncurses, db, iptables) worked for some strange reason.

This sounds strange for me, because building the cross-compiler did recognize the options:
emerge -1 cross-armv7a-hardfloat-linux-gnueabi/gcc (building cross-compiler on host):
 * CFLAGS="-O2 -pipe"
 * CXXFLAGS=""
 * LDFLAGS="-Wl,-O1 -Wl,--as-needed"

 * PREFIX:          /usr
 * BINPATH:         /usr/x86_64-pc-linux-gnu/armv7a-hardfloat-linux-gnueabi/gcc-bin/5.4.0
 * LIBPATH:         /usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/5.4.0
 * DATAPATH:        /usr/share/gcc-data/armv7a-hardfloat-linux-gnueabi/5.4.0
 * STDCXX_INCDIR:   /usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/5.4.0/include/g++-v5

 * Languages:       c,c++,fortran
* Configuring GCC with:
 *    --host=x86_64-pc-linux-gnu
 *    --target=armv7a-hardfloat-linux-gnueabi
 *    --build=x86_64-pc-linux-gnu
 *    --prefix=/usr
 *    --bindir=/usr/x86_64-pc-linux-gnu/armv7a-hardfloat-linux-gnueabi/gcc-bin/5.4.0
 *    --includedir=/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/5.4.0/include
 *    --datadir=/usr/share/gcc-data/armv7a-hardfloat-linux-gnueabi/5.4.0
 *    --mandir=/usr/share/gcc-data/armv7a-hardfloat-linux-gnueabi/5.4.0/man
 *    --infodir=/usr/share/gcc-data/armv7a-hardfloat-linux-gnueabi/5.4.0/info
 *    --with-gxx-include-dir=/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/5.4.0/include/g++-v5
 *    --with-python-dir=/share/gcc-data/armv7a-hardfloat-linux-gnueabi/5.4.0/python
 *    --enable-languages=c,c++,fortran
 *    --enable-obsolete
 *    --enable-secureplt
 *    --disable-werror
 *    --with-system-zlib
 *    --enable-nls
 *    --without-included-gettext
 *    --enable-checking=release
 *    --with-bugurl=https://bugs.gentoo.org/
 *    --with-pkgversion=Gentoo 5.4.0 p1.0, pie-0.6.5
 *    --enable-libstdcxx-time
 *    --enable-poison-system-directories
 *    --with-sysroot=/usr/armv7a-hardfloat-linux-gnueabi
 *    --disable-bootstrap
 *    --enable-__cxa_atexit
 *    --enable-clocale=gnu
 *    --disable-multilib
 *    --disable-altivec
 *    --disable-fixed-point
 *    --with-float=hard
 *    --with-arch=armv7-a
 *    --with-float=hard
 *    --with-fpu=vfpv3-d16
 *    --disable-libgcj
 *    --enable-libgomp
 *    --disable-libmudflap
 *    --disable-libssp
 *    --disable-libcilkrts
 *    --disable-libmpx
 *    --enable-vtable-verify
 *    --enable-libvtv
 *    --enable-lto
 *    --without-isl
 *    --enable-libsanitizer
 *    --with-fpu=neon-fp16


Ok, then let's try compiling gcc inside the arm chroot:
emerge -1u gcc (inside chroot):
In file included from /var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libgcc/libgcc2.c:56:0:
/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libgcc/libgcc2.h:209:20: error: ‘__fixsfdi’ undeclared here (not in a function)
 #define __NDW(a,b) __ ## a ## di ## b
                    ^
/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libgcc/libgcc2.h:282:19: note: in expansion of macro ‘__NDW’
 #define __fixsfdi __NDW(fixsf,)
                   ^
/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libgcc/config/arm/bpabi-lib.h:28:11: note: in expansion of macro ‘__fixsfdi’
   typeof (__##GCC_NAME) __aeabi_##AEABI_NAME \
           ^
/var/tmp/portage/sys-devel/gcc-5.4.0/work/gcc-5.4.0/libgcc/config/arm/bpabi-lib.h:48:33: note: in expansion of macro ‘RENAME_LIBRARY’
 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, f2lz) \


Did anyone get this thing compiled?
Back to top
View user's profile Send private message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 2985
Location: de

PostPosted: Tue Aug 23, 2016 6:09 am    Post subject: Reply with quote

Got it compiled.

I compiled the whole system already with gcc-5.4.0 from outside the chroot via cross-compiler. And then I compiled gcc-5.4.0 inside the qemu-arm chroot, which took several hours. But finally it worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum