relocation R_X86_64_PC32 against undefined symbol?

I get the following error when trying to build hsimports: [7 of 7] Compiling HsImport ( src/HsImport.hs, dist/build/HsImport.dyn_o ) /usr/bin/ld: dist/build/HsImport/Args.dyn_o: relocation R_X86_64_PC32 against undefined symbol `hsimportzm0zi2zi6zi3_Pathszuhsimport_version1_closure' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status What could be causing this? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus Do not meddle in the affairs of Wizards, for they are subtle and quick to anger. -- J.R.R Tolkien

Hi Magnus, On Sun, Jan 05, 2014 at 01:00:45PM +0100, Magnus Therning wrote:
I get the following error when trying to build hsimports:
[7 of 7] Compiling HsImport ( src/HsImport.hs, dist/build/HsImport.dyn_o ) /usr/bin/ld: dist/build/HsImport/Args.dyn_o: relocation R_X86_64_PC32 against undefined symbol `hsimportzm0zi2zi6zi3_Pathszuhsimport_version1_closure' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status
What could be causing this?
Could you please test it with hsimport 0.2.6.4. Greetings, Daniel

On Sun, Jan 05, 2014 at 01:21:30PM +0100, Daniel Trstenjak wrote:
Hi Magnus,
On Sun, Jan 05, 2014 at 01:00:45PM +0100, Magnus Therning wrote:
I get the following error when trying to build hsimports:
[7 of 7] Compiling HsImport ( src/HsImport.hs, dist/build/HsImport.dyn_o ) /usr/bin/ld: dist/build/HsImport/Args.dyn_o: relocation R_X86_64_PC32 against undefined symbol `hsimportzm0zi2zi6zi3_Pathszuhsimport_version1_closure' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status
What could be causing this?
Could you please test it with hsimport 0.2.6.4.
Still same problem. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they do not refer to reality. -- Albert Einstein

On Sun, Jan 05, 2014 at 01:44:56PM +0100, Magnus Therning wrote:
Still same problem.
Looking at the symbol name 'hsimportzm0zi2zi6zi3_Pathszuhsimport_version1_closure' I thought that I might just forgot to add the cabal created module 'Paths_hsimport' to the 'other-modules' list. But this doesn't seem to be the only issue. Greetings, Daniel

It seems to be a problem with the building of 'HsImport/Args.hs', which is the only module using the cabal module 'Paths_hsimport'. The in this regard relevant parts of 'HsImport/Args.hs' seem to be: {-# LANGUAGE ... CPP #-} ... #ifdef CABAL import Data.Version (showVersion) import Paths_hsimport (version) #endif And in 'hsimport.cabal' there's: ... Executable hsimport ... cpp-options: -DCABAL Could you try modifying the hsimport executable section: ... Executable hsimport ... cpp-options: -DCABAL extensions: CPP Greetings, Daniel

On Sun, Jan 05, 2014 at 02:36:07PM +0100, Daniel Trstenjak wrote:
It seems to be a problem with the building of 'HsImport/Args.hs', which is the only module using the cabal module 'Paths_hsimport'.
The in this regard relevant parts of 'HsImport/Args.hs' seem to be:
{-# LANGUAGE ... CPP #-}
...
#ifdef CABAL import Data.Version (showVersion) import Paths_hsimport (version) #endif
And in 'hsimport.cabal' there's:
... Executable hsimport ... cpp-options: -DCABAL
Could you try modifying the hsimport executable section:
... Executable hsimport ... cpp-options: -DCABAL extensions: CPP
Still no luck :( /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus You do not examine legislation in the light of the benefits it will convey if properly administered, but in the light of the wrongs it would do and the harms it would cause if improperly administered. -- Lyndon Johnson

Hi Magnus,
Still no luck :(
One last thing you could try, is to remove 'cpp-options: -DCABAL' from 'hsimport.cabal', then 'HsImport/Args.hs' shouldn't need 'Paths_hsimport' anymore. But the whole thing seems to be a cabal build issue, so asking for help on the cabal mailing list might make sense. Greetings, Daniel
participants (2)
-
Daniel Trstenjak
-
Magnus Therning