Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
crosscompile for raspberrypi armv6j-hardfloat-linux-gnueabi
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
Tender
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2005
Posts: 134

PostPosted: Wed Aug 29, 2018 3:49 pm    Post subject: crosscompile for raspberrypi armv6j-hardfloat-linux-gnueabi Reply with quote

Hello, while trying to fast refreshing the SD

The command:

Code:
ROOT=/usr/armv6j-hardfloat-linux-gnueabi armv6j-hardfloat-linux-gnueabi-emerge world -a


The error:

Code:
g++  -I/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp -I. -I/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp/../include -I/var/tmp/portage/$
ys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp/include  -O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attrib$
te -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp -I. -I/var/tmp/portage/sys-devel/gcc-7.3.0-r3/wo$
k/gcc-7.3.0/libcpp/../include -I/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp/include   -c -o charset.o -MT charset.o -MMD -MP -MF .deps/charset.Tpo /v$
r/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp/charset.c
mv -f mkheadersT mkheaders
g++: error: unrecognized command line option ‘-mfpu=vfp’; did you mean ‘-mcpu=’?
g++: error: unrecognized command line option ‘-mfloat-abi=hard’
g++  -I/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp -I. -I/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp/../include -I/var/tmp/portage/$
ys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp/include  -O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attrib$
te -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp -I. -I/var/tmp/portage/sys-devel/gcc-7.3.0-r3/wo$
k/gcc-7.3.0/libcpp/../include -I/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp/include   -c -o directives.o -MT directives.o -MMD -MP -MF .deps/directiv$
s.Tpo /var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libcpp/directives.c
make[2]: *** [Makefile:224: charset.o] Error 1
make[2]: *** Waiting for unfinished jobs....
g++: error: unrecognized command line option ‘-mfpu=vfp’; did you mean ‘-mcpu=’?
gcc   -o fixincl fixincl.o fixtests.o fixfixes.o server.o procopen.o fixlib.o fixopts.o ../libiberty/libiberty.a
g++: error: unrecognized command line option ‘-mfloat-abi=hard’
make[2]: *** [Makefile:224: directives.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/build/build-x86_64-pc-linux-gnu/libcpp'
make[1]: *** [Makefile:2755: all-build-libcpp] Error 2
make[1]: *** Waiting for unfinished jobs....


The info:

Code:

ROOT=/usr/armv6j-hardfloat-linux-gnueabi armv6j-hardfloat-linux-gnueabi-emerge --info
Portage 2.3.40 (python 2.7.14-final-0, !../../usr/portage/profiles/default/linux/arm/13.0/armv6j, gcc-7.3.0, glibc-2.26-r7, 4.14.65-gentoo x86_64)
=================================================================
System uname: Linux-4.14.65-gentoo-x86_64-Intel-R-_Celeron-R-_CPU_J3455_@_1.50GHz-with-gentoo-2.4.1
KiB Mem:     7808344 total,   2186720 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Wed, 29 Aug 2018 03:30:01 +0000
Head commit of repository gentoo: eb2411c7d6e17f9b7a5d84ab8b120ef2518985a5
sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p2) 2.30.0                                                                                                                                       distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.24.3-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.4.8::gentoo, 3.5.5::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo
sys-devel/binutils:       2.30-r2::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r3::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r7::gentoo
Repositories:                                                                                                                                                                                                                                                                                                                                   gentoo
location: /usr/portage
sync-type: rsync
sync-uri: rsync://lowpower4/gentoo-portage
priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: no
    sync-rsync-extra-opts:
    sync-rsync-verify-max-age: 24

ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard"
CHOST="armv6j-hardfloat-linux-gnueabi"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard"
DISTDIR="/mnt/archive/gentoo/distfiles/"
EMERGE_DEFAULT_OPTS="--autounmask=n -j1 --load-average 1.0 --keep-going=n --with-bdeps=y --deep --complete-graph"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_R
UNTIME_DIR"
FCFLAGS="-O2 -pipe -march=armv6j"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-o
wned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=armv6j"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5 -l4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/usr/armv6j-hardfloat-linux-gnueabi/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --
exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl arm berkdb bzip2 cli crypt cxx dri fortran gdbm iconv ipv6 modules ncurses nls nptl openmp pam pcre readline seccomp ssl tcpd unicode xattr zlib" APACHE2_MODUL
ES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile
 authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log
_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets stage
 words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp thumb v4 v5 v6" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate ev
ermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate
 tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_E
XTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGL
E_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap dummy v4l" XTAB
LES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos accoun
t"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXT
RA_OPTS


A lot of packages compile successfully before


Last edited by Tender on Wed Aug 29, 2018 8:20 pm; edited 2 times in total
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 19958
Location: here

PostPosted: Wed Aug 29, 2018 4:03 pm    Post subject: Reply with quote

https://bugs.gentoo.org/645920
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10147
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Aug 29, 2018 4:39 pm    Post subject: Reply with quote

Moved from Portage & Programming to Gentoo on ARM.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Tender
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2005
Posts: 134

PostPosted: Wed Aug 29, 2018 5:26 pm    Post subject: Reply with quote

Thanks, in the mean time the chrooted/native build are (slowly) going on...
Back to top
View user's profile Send private message
Tender
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2005
Posts: 134

PostPosted: Wed Aug 29, 2018 8:14 pm    Post subject: Reply with quote

About last post of https://bugs.gentoo.org/645920 may be wrong?

Quote:

Atman Sense 2018-05-11 19:47:24 UTC

Apparently work/build/Makefile takes the wrong CXXFLAGS_FOR_BUILD. You can work around it by setting

CFLAGS="$my_build_flags" CXXFLAGS="$my_build_flags" armv7a-hardfloat-linux-gnueabi-emerge gcc


I think the work around suggested is not applicable because is for armv7a-hardfloat-linux-gnueabi, and prepending CFLAGS and CXXFLAGS to the emerge command does not help.

More, I did a simple compile test
This are the two compilers available:

Code:

midpower4 ~/scripts # armv6j-hardfloat-linux-gnueabi-g++ -v
Using built-in specs.
COLLECT_GCC=armv6j-hardfloat-linux-gnueabi-g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/armv6j-hardfloat-linux-gnueabi/7.3.0/lto-wrapper
Target: armv6j-hardfloat-linux-gnueabi
Configured with: /var/tmp/portage/cross-armv6j-hardfloat-linux-gnueabi/gcc-7.3.0-r3/work/gcc-7.3.0/configure --host=x86_64-pc-linux-gnu --target=armv6j-hardfloat-linux-gnueabi --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/armv6j-hardfloat-linux-gnueabi/gcc-bin/7.3.0 --includedir=/usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/7.3.0/include --datadir=/usr/share/gcc-data/armv6j-hardfloat-linux-gnueabi/7.3.0 --mandir=/usr/share/gcc-data/armv6j-hardfloat-linux-gnueabi/7.3.0/man --infodir=/usr/share/gcc-data/armv6j-hardfloat-linux-gnueabi/7.3.0/info --with-gxx-include-dir=/usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/7.3.0/include/g++-v7 --with-python-dir=/share/gcc-data/armv6j-hardfloat-linux-gnueabi/7.3.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 7.3.0-r3 p1.4' --disable-esp --enable-libstdcxx-time --enable-poison-system-directories --with-sysroot=/usr/armv6j-hardfloat-linux-gnueabi --disable-bootstrap --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-altivec --disable-fixed-point --with-float=hard --with-arch=armv6j --with-float=hard --with-fpu=vfp --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --disable-libmpx --enable-vtable-verify --enable-libvtv --enable-lto --without-isl --enable-libsanitizer --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 7.3.0 (Gentoo 7.3.0-r3 p1.4)
Code:

midpower4 ~/scripts # g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/7.3.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/7.3.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/7.3.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/7.3.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/7.3.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 7.3.0-r3 p1.4' --disable-esp --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --disable-libmpx --enable-vtable-verify --enable-libvtv --enable-lto --without-isl --enable-libsanitizer --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 7.3.0 (Gentoo 7.3.0-r3 p1.4)


This is the test:

Code:

midpower4 ~/scripts # armv6j-hardfloat-linux-gnueabi-g++ -static test.cpp -O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard -s -o test
Code:
         
midpower4 ~/scripts # g++ -static test.cpp -O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard -s -o test
g++: error: unrecognized command line option ‘-mfpu=vfp’; did you mean ‘-mcpu=’?
g++: error: unrecognized command line option ‘-mfloat-abi=hard’


Don't you think the latter error is similar to the emerge gcc one?
It seems to me that the reason for the bug is the wrong compiler invocation, not the wrong cflags, what do you think?
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 19958
Location: here

PostPosted: Thu Aug 30, 2018 5:45 am    Post subject: Reply with quote

Tender wrote:
This is the test:

Code:

midpower4 ~/scripts # armv6j-hardfloat-linux-gnueabi-g++ -static test.cpp -O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard -s -o test
Code:
         
midpower4 ~/scripts # g++ -static test.cpp -O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard -s -o test
g++: error: unrecognized command line option ‘-mfpu=vfp’; did you mean ‘-mcpu=’?
g++: error: unrecognized command line option ‘-mfloat-abi=hard’


Don't you think the latter error is similar to the emerge gcc one?
It seems to me that the reason for the bug is the wrong compiler invocation, not the wrong cflags, what do you think?

What return [/code]
Yes is similar error and seems to not call correct g++. Can help this thread?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Tender
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2005
Posts: 134

PostPosted: Thu Aug 30, 2018 6:39 am    Post subject: Reply with quote

fedeliallalinea wrote:
Tender wrote:
This is the test:

Code:

midpower4 ~/scripts # armv6j-hardfloat-linux-gnueabi-g++ -static test.cpp -O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard -s -o test
Code:
         
midpower4 ~/scripts # g++ -static test.cpp -O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard -s -o test
g++: error: unrecognized command line option ‘-mfpu=vfp’; did you mean ‘-mcpu=’?
g++: error: unrecognized command line option ‘-mfloat-abi=hard’


Don't you think the latter error is similar to the emerge gcc one?
It seems to me that the reason for the bug is the wrong compiler invocation, not the wrong cflags, what do you think?

What return [/code]
Yes is similar error and seems to not call correct g++. Can help this thread?


Thanks, I've already seen the post and tried, but it did not help in my case
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 19958
Location: here

PostPosted: Thu Aug 30, 2018 7:47 am    Post subject: Reply with quote

Just for info what return command
Code:
$ ls -l $(which g++)

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Tender
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2005
Posts: 134

PostPosted: Thu Aug 30, 2018 7:54 am    Post subject: Reply with quote

fedeliallalinea wrote:
Just for info what return command
Code:
$ ls -l $(which g++)

Code:
midpower4 ~/scripts # ls -l $(which g++)
lrwxrwxrwx 1 root root 23 Jun 30 13:50 /usr/x86_64-pc-linux-gnu/gcc-bin/7.3.0/g++ -> x86_64-pc-linux-gnu-g++
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 41577
Location: 56N 3W

PostPosted: Thu Aug 30, 2018 7:46 pm    Post subject: Reply with quote

Tender,

gcc cross compiles if you only use -O2 --pipe.
This does mean that gcc itself is not built specifically for -march=armv6j -mfpu=vfp -mfloat-abi=hard but it will still produce code that is, when you feed it -march=armv6j -mfpu=vfp -mfloat-abi=hard in use.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Tender
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2005
Posts: 134

PostPosted: Fri Aug 31, 2018 2:31 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Tender,

gcc cross compiles if you only use -O2 --pipe.
This does mean that gcc itself is not built specifically for -march=armv6j -mfpu=vfp -mfloat-abi=hard but it will still produce code that is, when you feed it -march=armv6j -mfpu=vfp -mfloat-abi=hard in use.


Neddy,

great hint, thanks!

I've successfully compiled gcc with:

Code:

midpower4 /usr/armv6j-hardfloat-linux-gnueabi # ROOT=$PWD/ CFLAGS="-O2 -pipe" CXXFLAGS="-O2 -pipe" armv6j-hardfloat-linux-gnueabi-emerge gcc


also distcc, showed the same error, is compiling now (but I don't know if the remedy is suitable for it)

Two packages still complain:

sys-apps/util-linux
/usr/lib64/libc.a: error adding symbols: File format not recognized

sys-apps/portage
/usr/include/python2.7/pyport.h:895:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."

Do you have any more advice?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM 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