Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 855902 - sys-devel/gcc-10.4.0[d]: relocation R_X86_64_32 against symbol `main' can not be used when making a PIE object; recompile with -fPIE
Summary: sys-devel/gcc-10.4.0[d]: relocation R_X86_64_32 against symbol `main' can not...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 865025
  Show dependency tree
 
Reported: 2022-07-02 14:19 UTC by OKUMURA N. Shin-ya
Modified: 2022-08-22 01:54 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log.gz,269.05 KB, application/gzip)
2022-07-02 14:21 UTC, OKUMURA N. Shin-ya
Details
emerge --info (emerge-info.txt,7.66 KB, text/plain)
2022-07-02 15:51 UTC, OKUMURA N. Shin-ya
Details
'emerge --info' - Using ccache and distcc-pump (emerge --info.txt,11.44 KB, text/plain)
2022-08-17 12:47 UTC, Iade Gesso
Details
Fix relocation R_X86_64_32 (gcc-10-d.patch,2.35 KB, patch)
2022-08-19 22:01 UTC, Magnus Granberg
Details | Diff
build.log with Fix relocation R_X86_64_32 patch (build.log.lzma,501.26 KB, application/octet-stream)
2022-08-21 15:34 UTC, OKUMURA N. Shin-ya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description OKUMURA N. Shin-ya 2022-07-02 14:19:26 UTC
When emerge =sys-devel/gcc-10.4.0, it fails as follows;

/usr/x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/sys-devel/gcc-10.4.0/temp/idgen.LQQTe7.ltrans0.ltrans.o: relocation R_X86_64_32 against symbol `main' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
make[3]: *** [/var/tmp/portage/sys-devel/gcc-10.4.0/work/gcc-10.4.0/gcc/d/Make-lang.in:320: d/idgen] Error 1

Reproducible: Always

Steps to Reproduce:
1. emerge =sys-devel/gcc-10.4.0
2.
3.
Actual Results:  
As stated before.

Expected Results:  
emerge end successfully. :-)

I will attach emerge-info and build.log soon.
Comment 1 OKUMURA N. Shin-ya 2022-07-02 14:21:55 UTC
Created attachment 789623 [details]
build.log
Comment 2 OKUMURA N. Shin-ya 2022-07-02 14:29:39 UTC
WTF... Internal Server Error prevents to submit emerge --info.
I will try to submit tomorrow, sorry.

> The server encountered an internal error or misconfiguration and was unable to complete your request.
> 
> Please contact the server administrator at webmaster@gentoo.org to inform them of the time this error occurred, and the actions you performed just before this error.
> 
> More information about this error may be available in the server error log.
Comment 3 Ionen Wolkens gentoo-dev 2022-07-02 14:34:34 UTC
(In reply to OKUMURA N. Shin-ya from comment #2)
> WTF... Internal Server Error prevents to submit emerge --info.
> I will try to submit tomorrow, sorry.
That's typically because the browser didn't have read access to the file (or its leading directories) and sent bad data to bugzilla instead.
Comment 4 OKUMURA N. Shin-ya 2022-07-02 15:51:21 UTC
Created attachment 789626 [details]
emerge --info
Comment 5 OKUMURA N. Shin-ya 2022-07-02 15:52:00 UTC
(In reply to Ionen Wolkens from comment #3)
> (In reply to OKUMURA N. Shin-ya from comment #2)
> > WTF... Internal Server Error prevents to submit emerge --info.
> > I will try to submit tomorrow, sorry.
> That's typically because the browser didn't have read access to the file (or
> its leading directories) and sent bad data to bugzilla instead.

Thank you for your information! Successfully attached.
Comment 6 Luke A. Guest 2022-07-09 12:36:08 UTC
Same here.
Comment 7 Tamas Jantvik 2022-08-16 10:12:45 UTC
I hit this as well, now with sys-devel/gcc-10.4.0 being stable. Any hints from someone? :)
Comment 8 Iade Gesso 2022-08-17 12:45:18 UTC
(In reply to Tamas Jantvik from comment #7)
> I hit this as well, now with sys-devel/gcc-10.4.0 being stable. Any hints
> from someone? :)

Hi,
same issue here. I will attach my 'emerge --info'.


Iade
Comment 9 Iade Gesso 2022-08-17 12:47:14 UTC
Created attachment 799951 [details]
'emerge --info' - Using ccache and distcc-pump
Comment 10 Magnus Granberg gentoo-dev 2022-08-19 20:37:25 UTC
Do gcc 11.3 work?
Comment 11 Magnus Granberg gentoo-dev 2022-08-19 22:01:54 UTC
Created attachment 800203 [details, diff]
Fix relocation R_X86_64_32

Test this patch to see if it fix the relocation R_X86_64_32
Comment 12 OKUMURA N. Shin-ya 2022-08-21 05:51:41 UTC
(In reply to Magnus Granberg from comment #10)
> Do gcc 11.3 work?

Yes, gcc-{10.3.1_p20211126,11.3.0,12.1.1_p20220625} all work.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-21 06:05:29 UTC
(In reply to OKUMURA N. Shin-ya from comment #12)
> (In reply to Magnus Granberg from comment #10)
> > Do gcc 11.3 work?
> 
> Yes, gcc-{10.3.1_p20211126,11.3.0,12.1.1_p20220625} all work.

What about the patch on 10.4.0?
Comment 14 OKUMURA N. Shin-ya 2022-08-21 09:32:34 UTC
(In reply to Sam James from comment #13)
> What about the patch on 10.4.0?

If talking about comment #11 patch, please for a moment.
I'm trying it but it takes a large time to emerge with the patch.
Comment 15 OKUMURA N. Shin-ya 2022-08-21 12:09:05 UTC
The comment #11 patch works fine for me as of now.
But build.log shows as follows;
 * QA Notice: Files built without respecting LDFLAGS have been detected
 *  Please include the following list of files in your report:
 * /usr/lib/gcc/x86_64-pc-linux-gnu/10.4.0/32/libasan.so.6.0.0
(snip)
 * /usr/x86_64-pc-linux-gnu/gcc-bin/10.4.0/x86_64-pc-linux-gnu-gfortran
 * QA Notice: Installing libtool files (.la) without corresponding static libraries!
 *   /usr/libexec/gcc/x86_64-pc-linux-gnu/10.4.0/liblto_plugin.la
 * QA Notice: Pre-stripped files found:
 * /usr/lib64/go/10.4.0/x86_64-pc-linux-gnu/net.gox
(snip)
 * /usr/lib/go/10.4.0/x86_64-pc-linux-gnu/archive/tar.gox

I'll attach the build.log the next post.
Comment 16 OKUMURA N. Shin-ya 2022-08-21 15:34:52 UTC
Created attachment 800379 [details]
build.log with Fix relocation R_X86_64_32 patch
Comment 17 Larry the Git Cow gentoo-dev 2022-08-22 01:52:39 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=600bbd9a730071e98561457276232148804c6042

commit 600bbd9a730071e98561457276232148804c6042
Author:     Magnus Granberg <zorry@gentoo.org>
AuthorDate: 2022-08-22 01:44:40 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-08-22 01:52:35 +0000

    10.4.0: add 76_all_d_compiler_for_build_pie.patch
    
    Bug: https://bugs.gentoo.org/855902
    Signed-off-by: Sam James <sam@gentoo.org>

 .../gentoo/76_all_d_compiler_for_build_pie.patch   | 63 ++++++++++++++++++++++
 10.4.0/gentoo/README.history                       |  3 ++
 2 files changed, 66 insertions(+)
Comment 18 Larry the Git Cow gentoo-dev 2022-08-22 01:54:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93f66d07665edf36aa0aa931ea498aae841f4016

commit 93f66d07665edf36aa0aa931ea498aae841f4016
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-08-22 01:49:11 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-08-22 01:49:11 +0000

    sys-devel/gcc: fix build with USE=d for 10.4.0
    
    Closes: https://bugs.gentoo.org/855902
    Thanks-to: Magnus Granberg <zorry@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/Manifest          | 2 +-
 sys-devel/gcc/gcc-10.4.0.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)