Skip to content

[builtins] Add -fPIC to the flags to build libgif#21607

Merged
dpiparo merged 1 commit intoroot-project:masterfrom
jmcarcell:add-fpic
Mar 14, 2026
Merged

[builtins] Add -fPIC to the flags to build libgif#21607
dpiparo merged 1 commit intoroot-project:masterfrom
jmcarcell:add-fpic

Conversation

@jmcarcell
Copy link
Contributor

-fPIC is in the source code flags (both in 5.2.2 and the latest version, 6.1.2) and is causing errors when building in the LCG stacks. The errors look like

/cvmfs/sft.cern.ch/lcg/releases/binutils/2.40-acaab/x86_64-el9/bin/ld: ..<path-to-libgif-static>: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/cvmfs/sft.cern.ch/lcg/releases/binutils/2.40-acaab/x86_64-el9/bin/ld: failed to set dynamic section sizes: bad value

I have built on Alma 9 with GCC 14 and that doesn't appear with this change anymore. I think you didn't see it in your CI because there isn't a Linux version with this enabled.

@jmcarcell jmcarcell requested a review from dpiparo as a code owner March 14, 2026 08:15
@jmcarcell jmcarcell changed the title [core] Add -fPIC to the flags to build libgif [builtins] Add -fPIC to the flags to build libgif Mar 14, 2026
@github-actions
Copy link

Test Results

    22 files      22 suites   3d 2h 47m 37s ⏱️
 3 807 tests  3 806 ✅ 1 💤 0 ❌
75 796 runs  75 787 ✅ 9 💤 0 ❌

Results for commit 1be66db.

@will-cern
Copy link
Contributor

Hello!
Is it possible this flag needs adding in a few places? We are seeing the problem in our nightly build of ROOT master as well, but specific to lzma builtin

/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: ../builtins/LZMA-prefix/lib/liblzma.a(common.c.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: failed to set dynamic section sizes: bad value`

see https://gitlab.cern.ch/atlas/StatAnalysis/-/jobs/71456550

Cheers,
Will

@dpiparo
Copy link
Member

dpiparo commented Mar 14, 2026

Thanks @jmcarcell . @will-cern apologies for the issues, this is all very new and we need to work on some rough angles. Thanks for the report.

@dpiparo dpiparo merged commit adf5512 into root-project:master Mar 14, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants