Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664340 - sys-libs/glibc-2.27-r6 - /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/crtbegin.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a PIE object
Summary: sys-libs/glibc-2.27-r6 - /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/crtbegin.o: r...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 670018 681930 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-08-23 02:44 UTC by fkhp
Modified: 2019-03-28 23:02 UTC (History)
3 users (show)

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


Attachments
emerge -info (info,7.34 KB, text/plain)
2018-08-23 02:46 UTC, fkhp
Details
emerge -pqv (pqv,311 bytes, text/plain)
2018-08-23 02:47 UTC, fkhp
Details
build.log (build.log,42.28 KB, text/plain)
2018-08-23 02:55 UTC, fkhp
Details
environment (environment,139.12 KB, text/plain)
2018-08-23 02:56 UTC, fkhp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fkhp 2018-08-23 02:44:07 UTC
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/crtbegin.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a PIE object
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[2]: *** [../Rules:194: /var/tmp/portage/sys-libs/glibc-2.27-r6/work/build-amd64-x86_64-pc-linux-gnu-nptl/iconv/iconvconfig] Error 1


Reproducible: Always

Steps to Reproduce:
1.emerge -v1 glibc
2.
3.
Actual Results:  
failed

Expected Results:  
completed
Comment 1 fkhp 2018-08-23 02:46:53 UTC
Created attachment 544600 [details]
emerge -info
Comment 2 fkhp 2018-08-23 02:47:31 UTC
Created attachment 544602 [details]
emerge -pqv
Comment 3 fkhp 2018-08-23 02:55:41 UTC
Created attachment 544604 [details]
build.log
Comment 4 fkhp 2018-08-23 02:56:35 UTC
Created attachment 544606 [details]
environment
Comment 5 fkhp 2018-08-23 02:59:18 UTC
the same problem happens for gcc-7.3.0-r3 and sys-libs/glibc-2.27-r5
Comment 6 fkhp 2018-08-23 03:01:35 UTC
the same problem happens when using gcc-7.3.0-r3 to compile. and sys-libs/glibc-2.27-r5 with the same problem.
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2018-08-23 08:44:47 UTC
It might not be the primary problem but you set -fPIC in CFLAGS:
    CFLAGS="-mtune=core2 -march=core2 -O2 -msse4.1 -pipe -ffat-lto-objects -fPIC -fstack-protector-strong"

It's usually problematic as some CRT files are built in non-PIC mode.
For example crtbegin.o is for non-PIE objects while crtbeginS.o is for PIE/shared.

You will need to:
- get rid of CFLAGS=-fPIC
- enable USE=pie for gcc
- rebuild gcc
- rebuild glibc
Comment 8 fkhp 2018-08-28 01:48:51 UTC
this works well, and the problem resolved.
Comment 9 fkhp 2018-08-28 01:50:51 UTC
(In reply to Sergei Trofimovich from comment #7)
> It might not be the primary problem but you set -fPIC in CFLAGS:
>     CFLAGS="-mtune=core2 -march=core2 -O2 -msse4.1 -pipe -ffat-lto-objects
> -fPIC -fstack-protector-strong"
> 
> It's usually problematic as some CRT files are built in non-PIC mode.
> For example crtbegin.o is for non-PIE objects while crtbeginS.o is for
> PIE/shared.
> 
> You will need to:
> - get rid of CFLAGS=-fPIC
> - enable USE=pie for gcc
> - rebuild gcc
> - rebuild glibc

this works well, and the problem resolved.
Comment 10 Brian Evans (RETIRED) gentoo-dev 2018-11-01 13:50:24 UTC
*** Bug 670018 has been marked as a duplicate of this bug. ***
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2019-03-28 23:02:16 UTC
*** Bug 681930 has been marked as a duplicate of this bug. ***