[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#701461: marked as done (gcc cannot compile in amd64 using -fPIE and -pie)



Your message dated Wed, 8 May 2013 01:39:01 +0200
with message-id <20130507233901.GA12268@volta.aurel32.net>
and subject line Bug#701461: gcc cannot compile in amd64 using -fPIE and -pie
has caused the Debian Bug report #701461,
regarding gcc cannot compile in amd64 using -fPIE and -pie
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
701461: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701461
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: gcc
Version: 4:4.7.2-1
Severity: important

gcc cannot compile programs in amd64 with the -fPIE and -pie security flags. It seems that crt1.o is not compiled with -fPIC. I tested this with the "transmission" package:

Flags used:

export CFLAGS="-pipe -O2 -fPIE"
export CXXFLAGS="${CFLAGS}"
export LDFLAGS="-Wl,-pie"
./configure

Terminal output:

checking whether the C compiler works... no
configure: error: in `/home/riley/Desktop/transmission-2.77':
configure: error: C compiler cannot create executables
See `config.log' for more details

Relevant content in config.log:

configure:3759: checking whether the C compiler works
configure:3781: gcc -pipe -O2 -fPIE  -Wl,-pie conftest.c  >&5
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o: relocation R_X86_64_32S against `__libc_csu_fini' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status

--- End Message ---
--- Begin Message ---
On Sat, Feb 23, 2013 at 01:55:47PM +0100, Rick Terrel wrote:
> Package: gcc
> Version: 4:4.7.2-1
> Severity: important
> 
> gcc cannot compile programs in amd64 with the -fPIE and -pie security
> flags. It seems that crt1.o is not compiled with -fPIC. I tested this with

Which is expected. Scrt1.o should be used instead.

> the "transmission" package:
> 
> Flags used:
> 
> export CFLAGS="-pipe -O2 -fPIE"
> export CXXFLAGS="${CFLAGS}"
> export LDFLAGS="-Wl,-pie"
> ./configure
> 
> Terminal output:
> 
> checking whether the C compiler works... no
> configure: error: in `/home/riley/Desktop/transmission-2.77':
> configure: error: C compiler cannot create executables
> See `config.log' for more details
> 
> Relevant content in config.log:
> 
> configure:3759: checking whether the C compiler works
> configure:3781: gcc -pipe -O2 -fPIE  -Wl,-pie conftest.c  >&5
> /usr/bin/ld:
> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o:
> relocation R_X86_64_32S against `__libc_csu_fini' can not be used when
> making a shared object; recompile with -fPIC
> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o: could
> not read symbols: Bad value
> collect2: error: ld returned 1 exit status

You should not try to override linker flags, but instead teach gcc to
pass the correct flags. You should pass '-pie' to gcc instead of
'-Wl,-pie'.

Closing the bug.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

--- End Message ---

Reply to: