Magnus Therning | 5 Jan 13:00 2014

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 <at> therning.org   jabber: magnus <at> 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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Daniel Trstenjak | 5 Jan 13:21 2014
Picon

Re: relocation R_X86_64_PC32 against undefined symbol?


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
Magnus Therning | 5 Jan 13:44 2014

Re: relocation R_X86_64_PC32 against undefined symbol?

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 <at> therning.org   jabber: magnus <at> 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
(Continue reading)

Daniel Trstenjak | 5 Jan 14:19 2014
Picon

Re: relocation R_X86_64_PC32 against undefined symbol?


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
Daniel Trstenjak | 5 Jan 14:36 2014
Picon

Re: relocation R_X86_64_PC32 against undefined symbol?


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

(Continue reading)

Magnus Therning | 6 Jan 23:17 2014

Re: relocation R_X86_64_PC32 against undefined symbol?

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
(Continue reading)

Daniel Trstenjak | 7 Jan 10:16 2014
Picon

Re: relocation R_X86_64_PC32 against undefined symbol?


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
Daniel Trstenjak | 7 Jan 20:34 2014
Picon

Re: relocation R_X86_64_PC32 against undefined symbol?

On Mon, Jan 06, 2014 at 11:17:39PM +0100, Magnus Therning wrote:
> Still no luck :(

Perhaps 'hsimport 0.2.6.5' now finally solves the issue.

Greetings,
Daniel

Gmane