Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Trouble with avr-gcc and "-pie"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
nasaiya
Apprentice
Apprentice


Joined: 17 May 2007
Posts: 152

PostPosted: Fri Jun 26, 2020 8:07 pm    Post subject: Trouble with avr-gcc and "-pie" Reply with quote

Hi,
I have been trying to get avr-gcc to work for arduino projects, but I'm stuck with this pie problem...

Trying to build anything with avr-gcc results in:
Code:
cc1: warning: ‘-fPIC’ is not supported [-fPIC]
cc1: warning: ‘-fPIE’ is not supported [-fPIE]
cc1: warning: ‘-fstack-protector’ not supported for this target
Archiving built core (caching) in: /tmp/arduino_cache_130106/core/core_arduino_avr_uno_1621df717313d057c92202babd71649a.a
/usr/libexec/gcc/avr/ld: -pie not supported
collect2: error: ld returned 1 exit status


I can get rid of the compiler warnings with -fno-pic -fno-pie and -fno-stack-protector, but ld still fails with the same error...

The pie use flag is forced enabled for the cross-avr/gcc ebuild made with crossdev... is this the problem? Can it be disabled? Or perhaps some other workaround?

Thanks!


PS: In case it helps...

Code:

[ebuild   R    ] cross-avr/gcc-9.3.0:9.3.0::crossdev  USE="cxx hardened (multilib) nls nptl openmp (pie) (ssp) -ada (-altivec) -d -debug -doc (-fixed-point) -fortran -go -graphite -jit -libssp -lto -objc -objc++ -objc-gc (-pch) -pgo -sanitize -systemtap -test -vanilla -vtv" 0 KiB


Code:

# emerge --info
Portage 2.3.99 (python 3.7.7-final-0, default/linux/amd64/17.0/desktop/plasma, gcc-9.3.0, glibc-2.30-r8, 5.6.10-gentoo x86_64)
=================================================================
System uname: Linux-5.6.10-gentoo-x86_64-AMD_Ryzen_5_1600X_Six-Core_Processor-with-gentoo-2.6
KiB Mem:    16388688 total,   8307716 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Thu, 04 Jun 2020 00:30:01 +0000
Head commit of repository gentoo: ad2611ec269d794e23b24f35daab9eba3d6b951c
sh bash 5.0_p17
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
app-shells/bash:          5.0_p17::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.18::gentoo, 3.6.10-r2::gentoo, 3.7.7-r2::gentoo, 3.8.2-r2::gentoo
dev-util/cmake:           3.16.5::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.3.0::gentoo
sys-devel/gcc-config:     2.2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r8::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts:
    sync-rsync-verify-max-age: 24

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

local
    location: /usr/local/portage
    masters: gentoo
    priority: 40

raiagent
    location: /var/lib/layman/raiagent
    masters: gentoo
    priority: 50

waebbl
    location: /var/lib/layman/waebbl
    masters: gentoo raiagent
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=znver1 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=znver1 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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="-march=znver1 -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox selinux sesandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=znver1 -O2 -pipe"
GENTOO_MIRRORS="http://mirrors.evowise.com/gentoo/ https://mirrors.evowise.com/gentoo/ http://mirror.sjc02.svwh.net/gentoo/ http://gentoo.osuosl.org/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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="X a52 aac acl acpi activities alsa amd64 bluetooth branding bzip2 cairo cdda cdr crypt cups dbus declarative dts dvd dvdr elogind emboss encode exif flac gif gpm gtk hardened iconv icu ipv6 jpeg kde kipi kwallet lcms ldap libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon pie plasma png policykit ppds pulseaudio qml qt5 readline sdl seccomp selinux semantic-desktop spell split-usr ssl ssp startup-notification svg tiff truetype ubac udev udisks unconfined unicode upower usb vorbis widgets wxwidgets x264 xattr xcb xml xtpax xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" 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 sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="radeon" 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, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

_________________
If it ain't broke - fix it till it is!
Back to top
View user's profile Send private message
Phoenix591
Apprentice
Apprentice


Joined: 17 Sep 2007
Posts: 296

PostPosted: Sat Jun 27, 2020 8:15 pm    Post subject: Reply with quote

you can unforce pie by putting an entry in /etc/portage/profile/package.use.force/(choice of name) cross-avr/gcc -pie and then you can specify -pie in a package.use entry for it (needs both, do not use the automatically generated cross-avr files as they can be overwritten).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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