Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[CROSSDEV] Generated arm-none-eabi toochain linker errors
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
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 225

PostPosted: Thu Jun 21, 2018 11:49 am    Post subject: [CROSSDEV] Generated arm-none-eabi toochain linker errors Reply with quote

I'm trying to compile https://github.com/libopencm3/libopencm3-examples with an arm-none-eabi toolchain generated by crossdev.

The libopencm3 developers link to some precompiled toolchain which works perfectly: https://launchpad.net/gcc-arm-embedded
The crossdev generated toochain always produces some linker error like:
Code:
error: i2c.elf uses VFP register arguments, /usr/lib/gcc/arm-none-eabi/7.3.0/../../../../arm-none-eabi/lib/libnosys.a(isatty.o) does not

or sometimes
Code:
/usr/libexec/gcc/arm-none-eabi/ld: error: /home/bstaletic/eurobot2k17/build/debug/obj/tasks/task_blinky_led.o uses VFP register arguments, /home/bstaletic/eurobot2k17/build/debug/bin/eurobot2k17.elf does not


What looks interesting is the output of "arm-non-eabi-gcc -print-multi-lib":
Code:

bstaletic@gentoo eurobot2k17  (git)-[master]-% arm-none-eabi-gcc -print-multi-lib
.;
thumb;@mthumb
fpu;@mfloat-abi=hard
bstaletic@gentoo eurobot2k17  (git)-[master]-% ~/arm-none/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc -print-multi-lib
.;
thumb;@mthumb
hard;@mfloat-abi=hard
thumb/v6-m;@mthumb@march=armv6s-m
thumb/v7-m;@mthumb@march=armv7-m
thumb/v7e-m;@mthumb@march=armv7e-m
thumb/v7-ar;@mthumb@march=armv7
thumb/v8-m.base;@mthumb@march=armv8-m.base
thumb/v8-m.main;@mthumb@march=armv8-m.main
thumb/v7e-m/fpv4-sp/softfp;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=softfp
thumb/v7e-m/fpv4-sp/hard;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=hard
thumb/v7e-m/fpv5/softfp;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=softfp
thumb/v7e-m/fpv5/hard;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=hard
thumb/v7-ar/fpv3/softfp;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=softfp
thumb/v7-ar/fpv3/hard;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=hard
thumb/v8-m.main/fpv5-sp/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=softfp
thumb/v8-m.main/fpv5-sp/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=hard
thumb/v8-m.main/fpv5/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=softfp
thumb/v8-m.main/fpv5/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=hard


Here's the output of "equery u cross-arm-none-eabi/gcc":
Code:

[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for cross-arm-none-eabi/gcc-7.3.0-r3:
 U I
 - - cilk            : Support the Cilk Plus language (C/C++ based languages for parallel programming)
 + + cxx             : Build support for C++ (bindings, extra libraries, code generation, ...)
 - - debug           : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
                       https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 - - doc             : Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
 - - fortran         : Add support for fortran
 - - go              : Build the GCC Go language frontend.
 - - graphite        : Add support for the framework for loop optimizations based on a polyhedral intermediate representation
 - - hardened        : Activate default security enhancements for toolchain (gcc, glibc, binutils)
 - - jit             : Enable libgccjit so other applications can embed gcc for Just-In-Time compilation. This will slow down the compiler a bit as it forces all of the toolchain to be
                       shared libs.
 - - libssp          : Build SSP support into a dedicated library rather than use the code in the C library (DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT IT DOES)
 - - mpx             : Enable support for Intel Memory Protection Extensions (MPX)
 + + nls             : Add Native Language Support (using gettext - GNU locale utilities)
 + + nptl            : Enable support for Native POSIX Threads Library, the new threading module (requires linux-2.6 or better usually)
 - - objc            : Build support for the Objective C code language
 - - objc++          : Build support for the Objective C++ language
 - - objc-gc         : Build support for the Objective C code language Garbage Collector
 - - openmp          : Build support for the OpenMP (support parallel computing), requires >=sys-devel/gcc-4.2 built with USE="openmp"
 + + pch             : Enable precompiled header support for faster compilation at the expense of disk space and memory (>=sys-devel/gcc-3.4 only)
 - - pgo             : Build GCC using Profile Guided Optimization (PGO)
 + + pie             : Build programs as Position Independent Executables (a security hardening technique)
 - - regression-test : Run the testsuite and install the results (requires FEATURES=test)
 - - sanitize        : Build support for various sanitizer functions (ASAN/TSAN/etc...)
 + + ssp             : Build packages with stack smashing protector on by default
 - - vanilla         : Do not add extra patches which change default behaviour; DO NOT USE THIS ON A GLOBAL SCALE as the severity of the meaning changes drastically


and the "emerge --info 'cross-arm-none-eabi/gcc":
Code:

Portage 2.3.40 (python 3.6.5-final-0, default/linux/amd64/17.1, gcc-8.1.0, glibc-2.27-r4, 4.16.12-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.16.12-gentoo-x86_64-Intel-R-_Core-TM-_i7-3610QM_CPU_@_2.30GHz-with-gentoo-2.6
KiB Mem:     8012268 total,   4318132 free
KiB Swap:    8388604 total,   8348668 free
Timestamp of repository gentoo: Tue, 19 Jun 2018 10:06:11 +0000
Head commit of repository gentoo: e1c52a2fe44402ac941f9a131be6f07b0aad0041

sh bash 4.4_p23
ld GNU ld (Gentoo 2.30 p3) 2.30.0
app-shells/bash:          4.4_p23::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5-r1::gentoo
dev-util/cmake:           3.11.4::gentoo
sys-apps/baselayout:      2.6::gentoo
sys-apps/openrc:          0.37::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.30-r3::gentoo
sys-devel/gcc:            8.1.0-r3::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r3::gentoo
sys-kernel/linux-headers: 4.17::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: git://github.com/gentoo-mirror/gentoo
    priority: -1000

bstaletic
    location: /usr/local/portage
    masters: gentoo
    priority: 9999

crossdev
    location: /usr/local/crossdev
    masters: gentoo
    priority: 9999

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
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_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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 alsa amd64 bzip2 cli crypt cxx dri ffmpeg gdbm iconv libressl libtirpc modules mp3 multilib ncurses nls nptl opengl openmp readline savedconfig seccomp ssl tcpd threads unicode xattr zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="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_X86="aes avx f16c mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="libressl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore 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="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86 AArch64 ARM" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6" RUBY_TARGETS="ruby23" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

cross-arm-none-eabi/gcc-7.3.0-r3::crossdev was built with the following:
USE="cxx (multilib) nls nptl pch pie ssp (-altivec) -cilk -debug -doc (-fixed-point) -fortran -go -graphite -hardened -jit -libssp -mpx -objc -objc++ -objc-gc -openmp -pgo -regression-test -sanitize -vanilla -vtv" ABI_X86="(64)"
CFLAGS="-O2 -pipe"
CXXFLAGS="-O2 -pipe"


Any idea what am I doing wronog? Or what is crossdev doing wrong?
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4933
Location: Dark side of the mood

PostPosted: Tue Jul 03, 2018 12:54 pm    Post subject: Re: [CROSSDEV] Generated arm-none-eabi toochain linker error Reply with quote

bstaletic wrote:
The crossdev generated toochain always produces some linker error like:
Code:
error: i2c.elf uses VFP register arguments, /usr/lib/gcc/arm-none-eabi/7.3.0/../../../../arm-none-eabi/lib/libnosys.a(isatty.o) does not

or sometimes
Code:
/usr/libexec/gcc/arm-none-eabi/ld: error: /home/bstaletic/eurobot2k17/build/debug/obj/tasks/task_blinky_led.o uses VFP register arguments, /home/bstaletic/eurobot2k17/build/debug/bin/eurobot2k17.elf does not

Please provide the complete error message. What follows that eluded "[...] does not" actually *is* what matters to diagnose the problem.
_________________
Dealing with computers is the best way to get sucked into more troubles than any sane person can cope with!
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Jul 03, 2018 1:52 pm    Post subject: Reply with quote

Moved from Portage & Programming to Gentoo on ARM.
_________________
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
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