Skip to content

Conversation

@smoors
Copy link
Contributor

@smoors smoors commented May 20, 2020

needed for ARGoS, to avoid compilation errors like this:

/apps/brussel/CO7/ivybridge-ib/software/binutils/2.34-GCCcore-9.3.0/bin/ld.gold: error: /apps/brussel/CO7/ivybridge-ib/software/Lua/5.3.5-GCCcore-9.3.0/lib/liblua.a(lapi.o): requires dynamic R_X86_64_32 reloc against 'luaO_nilobject_' which may overflow at runtime; recompile with -fPIC
/apps/brussel/CO7/ivybridge-ib/software/binutils/2.34-GCCcore-9.3.0/bin/ld.gold: error: /apps/brussel/CO7/ivybridge-ib/software/Lua/5.3.5-GCCcore-9.3.0/lib/liblua.a(ldebug.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/apps/brussel/CO7/ivybridge-ib/software/binutils/2.34-GCCcore-9.3.0/bin/ld.gold: error: /apps/brussel/CO7/ivybridge-ib/software/Lua/5.3.5-GCCcore-9.3.0/lib/liblua.a(ldo.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/apps/brussel/CO7/ivybridge-ib/software/binutils/2.34-GCCcore-9.3.0/bin/ld.gold: error: /apps/brussel/CO7/ivybridge-ib/software/Lua/5.3.5-GCCcore-9.3.0/lib/liblua.a(ldump.o): requires unsupported dynamic reloc 11; recompile with -fPIC
/apps/brussel/CO7/ivybridge-ib/software/binutils/2.34-GCCcore-9.3.0/bin/ld.gold: error: /apps/brussel/CO7/ivybridge-ib/software/Lua/5.3.5-GCCcore-9.3.0/lib/liblua.a(lgc.o): requires unsupported dynamic reloc 11; recompile with -fPIC
/apps/brussel/CO7/ivybridge-ib/software/binutils/2.34-GCCcore-9.3.0/bin/ld.gold: error: /apps/brussel/CO7/ivybridge-ib/software/Lua/5.3.5-GCCcore-9.3.0/lib/liblua.a(lmem.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC

also added EB defined CFLAGS and optionally user defined MYCFLAGS.
tested with Lua-5.3.4 and Lua-5.3.5.

@akesandgren
Copy link
Contributor

That would normally be done by adding pic: true in the toolchainopts

@smoors
Copy link
Contributor Author

smoors commented May 22, 2020

That would normally be done by adding pic: true in the toolchainopts

@akesandgren that's also fine to me. I was not sure where to add it because several other easyblocks also add it unconditionally.

@smoors
Copy link
Contributor Author

smoors commented May 22, 2020

this PR is still necessary because the toolchainopts are not picked up without adding CFLAGS.

@smoors smoors changed the title add -fPIC flag to Lua easyblock make sure CFLAGS and MYCFLAGS are picked up in Lua easyblock May 22, 2020
@smoors smoors changed the title make sure CFLAGS and MYCFLAGS are picked up in Lua easyblock make sure CFLAGS and MYCFLAGS are used in Lua easyblock May 22, 2020
if LooseVersion(self.version) > LooseVersion('5.2'):
mycflags.append('-DLUA_COMPAT_5_2')
if LooseVersion(self.version) > LooseVersion('5.3'):
mycflags.append(os.getenv('CFLAGS', ''))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this behind an if? It should be used in general?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in dda269b and re-tested with all existing Lua easyconfigs, works like a charm

@boegel boegel added this to the release after 4.2.2 (4.2.3?) milestone Jul 3, 2020
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants