Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 713924 - dev-db/mysql-connector-c fails to compile on ia64: relocation truncated to fit: GPREL22
Summary: dev-db/mysql-connector-c fails to compile on ia64: relocation truncated to fi...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 709620
  Show dependency tree
 
Reported: 2020-03-22 10:45 UTC by Agostino Sarubbo
Modified: 2022-03-21 22:04 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,333.80 KB, text/plain)
2020-03-22 10:45 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-03-22 10:45:14 UTC
This is an auto-filled bug because dev-db/mysql-connector-c fails to compile on ia64. Feel free to adjust the summary to clarify the exact issue. Attached build log and emerge --info
Comment 1 Agostino Sarubbo gentoo-dev 2020-03-22 10:45:24 UTC
Created attachment 624162 [details]
build.log

build log and emerge --info
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-05 16:19:00 UTC
> /usr/lib/gcc/ia64-unknown-linux-gnu/9.2.0/include/g++-v9/iostream:74:(.text.startup+0x42): relocation truncated to fit: GPREL22 against symbol `__dso_handle' defined in .data section in /usr/lib/gcc/ia64-unknown-linux-gnu/9.2.0/crtbeginS.o
> /usr/lib/gcc/ia64-unknown-linux-gnu/9.2.0/../../../../ia64-unknown-linux-gnu/bin/ld: final link failed: nonrepresentable section on output
> collect2: error: ld returned 1 exit status

Looks like a GCC issue? Found https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90714 ... not sure if this should be fixed in Gentoo already/in the meanwhile.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-08-05 18:24:47 UTC
(In reply to Thomas Deutschmann from comment #2)
> > /usr/lib/gcc/ia64-unknown-linux-gnu/9.2.0/include/g++-v9/iostream:74:(.text.startup+0x42): relocation truncated to fit: GPREL22 against symbol `__dso_handle' defined in .data section in /usr/lib/gcc/ia64-unknown-linux-gnu/9.2.0/crtbeginS.o
> > /usr/lib/gcc/ia64-unknown-linux-gnu/9.2.0/../../../../ia64-unknown-linux-gnu/bin/ld: final link failed: nonrepresentable section on output
> > collect2: error: ld returned 1 exit status
> 
> Looks like a GCC issue? Found
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90714 ... not sure if this
> should be fixed in Gentoo already/in the meanwhile.

Yeah, probably a minor deficiency in gcc's crtstartupS.o. I wonder if it could use GPREL64.

It's an overflow in short relocations within code section. ia64 assumes 22 bit offsets within code section will be enough as a default (with 128-bit instruction alignment, which gives 4 more addressable bits). I believe that translates to 64MB .text section per module (executable or library) if you are lucky (usually it +/-32MB offsets).

The error usually means the executable is too large to be linked without pessimizing generated code into using wider offsets.

My guess is that crtstartupS.o makes a reasonable 64MB assumption and fails.

Don't know if there are simple ways to decrease .text section size aside from trying -O1/-Os. Let's see how easy it is to tweak crtstartup.S.