Linking + zstd on FreeBSD

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Linking + zstd on FreeBSD

Vanessa McHale-2
I tried linking against zstd within a Vagrant simulating FreeBSD. I get
the following:

ld: error: duplicate symbol: XXH64
>>> defined at xxhash.c
>>>            xxhash.o:(XXH64) in archive
/home/vagrant/.cabal/store/ghc-8.8.3/zstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e/lib/libHSzstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e.a
>>> defined at xxhash.c:693
(/wrkdirs/usr/ports/lang/ghc/work/ghc-8.8.3/rts/xxhash.c:693)
>>>            RTS.o:(.text.XXH64+0x0) in archive
/usr/local/lib/ghc-8.8.3/rts/libHSrts.a

...

I am using GHC version 8.8.3_1 and cabal-install 3.0 installed by 'sudo
pkg install ...'

(I was trying to run cabal install language-dickinson)

Cheers,
Vanessa McHale



_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

signature.asc (673 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Linking + zstd on FreeBSD

Jinwoo Lee
The error message seems to say why. The GHC RTS already has xxhash.c and zstd also has that file. I'm not sure how to resolve this though.


On Mon, Jun 29, 2020 at 7:44 AM Vanessa McHale <[hidden email]> wrote:
I tried linking against zstd within a Vagrant simulating FreeBSD. I get
the following:

ld: error: duplicate symbol: XXH64
>>> defined at xxhash.c
>>>            xxhash.o:(XXH64) in archive
/home/vagrant/.cabal/store/ghc-8.8.3/zstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e/lib/libHSzstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e.a
>>> defined at xxhash.c:693
(/wrkdirs/usr/ports/lang/ghc/work/ghc-8.8.3/rts/xxhash.c:693)
>>>            RTS.o:(.text.XXH64+0x0) in archive
/usr/local/lib/ghc-8.8.3/rts/libHSrts.a

...

I am using GHC version 8.8.3_1 and cabal-install 3.0 installed by 'sudo
pkg install ...'

(I was trying to run cabal install language-dickinson)

Cheers,
Vanessa McHale


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Linking + zstd on FreeBSD

Carter Schonwald
When binding c libraries, I often prefix a custom/unique Descriptive sequence  for All linker visible symbols. 

So Eg you could do vanmach_zstdlib_ as a prefix

On Tue, Jun 30, 2020 at 12:32 PM Jinwoo Lee <[hidden email]> wrote:
The error message seems to say why. The GHC RTS already has xxhash.c and zstd also has that file. I'm not sure how to resolve this though.


On Mon, Jun 29, 2020 at 7:44 AM Vanessa McHale <[hidden email]> wrote:
I tried linking against zstd within a Vagrant simulating FreeBSD. I get
the following:

ld: error: duplicate symbol: XXH64
>>> defined at xxhash.c
>>>            xxhash.o:(XXH64) in archive
/home/vagrant/.cabal/store/ghc-8.8.3/zstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e/lib/libHSzstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e.a
>>> defined at xxhash.c:693
(/wrkdirs/usr/ports/lang/ghc/work/ghc-8.8.3/rts/xxhash.c:693)
>>>            RTS.o:(.text.XXH64+0x0) in archive
/usr/local/lib/ghc-8.8.3/rts/libHSrts.a

...

I am using GHC version 8.8.3_1 and cabal-install 3.0 installed by 'sudo
pkg install ...'

(I was trying to run cabal install language-dickinson)

Cheers,
Vanessa McHale


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Linking + zstd on FreeBSD

Vanessa McHale-2

Fair enough, I suppose what I don't understand is: why is this only happening on FreeBSD (in Vagrant)? I am able to compile on Linux, Mac, and Windows!

Cheers,
Vanessa McHale

On 7/8/20 5:33 PM, Carter Schonwald wrote:
When binding c libraries, I often prefix a custom/unique Descriptive sequence  for All linker visible symbols. 

So Eg you could do vanmach_zstdlib_ as a prefix

On Tue, Jun 30, 2020 at 12:32 PM Jinwoo Lee <[hidden email]> wrote:
The error message seems to say why. The GHC RTS already has xxhash.c and zstd also has that file. I'm not sure how to resolve this though.


On Mon, Jun 29, 2020 at 7:44 AM Vanessa McHale <[hidden email]> wrote:
I tried linking against zstd within a Vagrant simulating FreeBSD. I get
the following:

ld: error: duplicate symbol: XXH64
>>> defined at xxhash.c
>>>            xxhash.o:(XXH64) in archive
/home/vagrant/.cabal/store/ghc-8.8.3/zstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e/lib/libHSzstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e.a
>>> defined at xxhash.c:693
(/wrkdirs/usr/ports/lang/ghc/work/ghc-8.8.3/rts/xxhash.c:693)
>>>            RTS.o:(.text.XXH64+0x0) in archive
/usr/local/lib/ghc-8.8.3/rts/libHSrts.a

...

I am using GHC version 8.8.3_1 and cabal-install 3.0 installed by 'sudo
pkg install ...'

(I was trying to run cabal install language-dickinson)

Cheers,
Vanessa McHale


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

signature.asc (673 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Linking + zstd on FreeBSD

Carter Schonwald
That’s a really good question!

I guess one way to narrow it down is what’s the  linker implementation on each env? I think you can arrange to use the same ld impl on bsd and Linux if you want, since both are elf platforms.  Are they both doing dynamic or static linking? Are they using the same Ld implementation?  It’s certainly strange to have there be a difference in behavior between two x64 elf platforms, 

On Thu, Jul 9, 2020 at 8:31 AM Vanessa McHale <[hidden email]> wrote:

Fair enough, I suppose what I don't understand is: why is this only happening on FreeBSD (in Vagrant)? I am able to compile on Linux, Mac, and Windows!

Cheers,
Vanessa McHale

On 7/8/20 5:33 PM, Carter Schonwald wrote:
When binding c libraries, I often prefix a custom/unique Descriptive sequence  for All linker visible symbols. 

So Eg you could do vanmach_zstdlib_ as a prefix

On Tue, Jun 30, 2020 at 12:32 PM Jinwoo Lee <[hidden email]> wrote:
The error message seems to say why. The GHC RTS already has xxhash.c and zstd also has that file. I'm not sure how to resolve this though.


On Mon, Jun 29, 2020 at 7:44 AM Vanessa McHale <[hidden email]> wrote:
I tried linking against zstd within a Vagrant simulating FreeBSD. I get
the following:

ld: error: duplicate symbol: XXH64
>>> defined at xxhash.c
>>>            xxhash.o:(XXH64) in archive
/home/vagrant/.cabal/store/ghc-8.8.3/zstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e/lib/libHSzstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e.a
>>> defined at xxhash.c:693
(/wrkdirs/usr/ports/lang/ghc/work/ghc-8.8.3/rts/xxhash.c:693)
>>>            RTS.o:(.text.XXH64+0x0) in archive
/usr/local/lib/ghc-8.8.3/rts/libHSrts.a

...

I am using GHC version 8.8.3_1 and cabal-install 3.0 installed by 'sudo
pkg install ...'

(I was trying to run cabal install language-dickinson)

Cheers,
Vanessa McHale


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Linking + zstd on FreeBSD

Brandon Allbery
I can think of a few more possibilities. Has anyone checked whether
the RTS symbol is, say, conditional on non-glibc?

On 7/9/20, Carter Schonwald <[hidden email]> wrote:

> That’s a really good question!
>
> I guess one way to narrow it down is what’s the  linker implementation on
> each env? I think you can arrange to use the same ld impl on bsd and Linux
> if you want, since both are elf platforms.  Are they both doing dynamic or
> static linking? Are they using the same Ld implementation?  It’s certainly
> strange to have there be a difference in behavior between two x64 elf
> platforms,
>
> On Thu, Jul 9, 2020 at 8:31 AM Vanessa McHale <[hidden email]> wrote:
>
>> Fair enough, I suppose what I don't understand is: why is this only
>> happening on FreeBSD (in Vagrant)? I am able to compile on Linux, Mac,
>> and
>> Windows!
>>
>> Cheers,
>> Vanessa McHale
>> On 7/8/20 5:33 PM, Carter Schonwald wrote:
>>
>> When binding c libraries, I often prefix a custom/unique Descriptive
>> sequence  for All linker visible symbols.
>>
>> So Eg you could do vanmach_zstdlib_ as a prefix
>>
>> On Tue, Jun 30, 2020 at 12:32 PM Jinwoo Lee <[hidden email]> wrote:
>>
>>> The error message seems to say why. The GHC RTS already has xxhash.c and
>>> zstd also has that file. I'm not sure how to resolve this though.
>>>
>>>
>>> On Mon, Jun 29, 2020 at 7:44 AM Vanessa McHale <[hidden email]>
>>> wrote:
>>>
>>>> I tried linking against zstd within a Vagrant simulating FreeBSD. I get
>>>> the following:
>>>>
>>>> ld: error: duplicate symbol: XXH64
>>>> >>> defined at xxhash.c
>>>> >>>            xxhash.o:(XXH64) in archive
>>>>
>>>> /home/vagrant/.cabal/store/ghc-8.8.3/zstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e/lib/libHSzstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e.a
>>>> >>> defined at xxhash.c:693
>>>> (/wrkdirs/usr/ports/lang/ghc/work/ghc-8.8.3/rts/xxhash.c:693)
>>>> >>>            RTS.o:(.text.XXH64+0x0) in archive
>>>> /usr/local/lib/ghc-8.8.3/rts/libHSrts.a
>>>>
>>>> ...
>>>>
>>>> I am using GHC version 8.8.3_1 and cabal-install 3.0 installed by 'sudo
>>>> pkg install ...'
>>>>
>>>> (I was trying to run cabal install language-dickinson)
>>>>
>>>> Cheers,
>>>> Vanessa McHale
>>>>
>>>>
>>>> _______________________________________________
>>>> Haskell-Cafe mailing list
>>>> To (un)subscribe, modify options or view archives go to:
>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>>>> Only members subscribed via the mailman list are allowed to post.
>>>
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> To (un)subscribe, modify options or view archives go to:
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>>> Only members subscribed via the mailman list are allowed to post.
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.
>


--
brandon s allbery kf8nh
[hidden email]
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Linking + zstd on FreeBSD

Carter Schonwald
That’s a really good point about conditional compilation / cpp in the rts across platforms. 

On Thu, Jul 9, 2020 at 2:23 PM Brandon Allbery <[hidden email]> wrote:
I can think of a few more possibilities. Has anyone checked whether
the RTS symbol is, say, conditional on non-glibc?

On 7/9/20, Carter Schonwald <[hidden email]> wrote:
> That’s a really good question!
>
> I guess one way to narrow it down is what’s the  linker implementation on
> each env? I think you can arrange to use the same ld impl on bsd and Linux
> if you want, since both are elf platforms.  Are they both doing dynamic or
> static linking? Are they using the same Ld implementation?  It’s certainly
> strange to have there be a difference in behavior between two x64 elf
> platforms,
>
> On Thu, Jul 9, 2020 at 8:31 AM Vanessa McHale <[hidden email]> wrote:
>
>> Fair enough, I suppose what I don't understand is: why is this only
>> happening on FreeBSD (in Vagrant)? I am able to compile on Linux, Mac,
>> and
>> Windows!
>>
>> Cheers,
>> Vanessa McHale
>> On 7/8/20 5:33 PM, Carter Schonwald wrote:
>>
>> When binding c libraries, I often prefix a custom/unique Descriptive
>> sequence  for All linker visible symbols.
>>
>> So Eg you could do vanmach_zstdlib_ as a prefix
>>
>> On Tue, Jun 30, 2020 at 12:32 PM Jinwoo Lee <[hidden email]> wrote:
>>
>>> The error message seems to say why. The GHC RTS already has xxhash.c and
>>> zstd also has that file. I'm not sure how to resolve this though.
>>>
>>>
>>> On Mon, Jun 29, 2020 at 7:44 AM Vanessa McHale <[hidden email]>
>>> wrote:
>>>
>>>> I tried linking against zstd within a Vagrant simulating FreeBSD. I get
>>>> the following:
>>>>
>>>> ld: error: duplicate symbol: XXH64
>>>> >>> defined at xxhash.c
>>>> >>>            xxhash.o:(XXH64) in archive
>>>>
>>>> /home/vagrant/.cabal/store/ghc-8.8.3/zstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e/lib/libHSzstd-0.1.2.0-c8ee757c8e8a7307779ab3cfbc91f3445940e16bbf8f9916f4c90432a0ac499e.a
>>>> >>> defined at xxhash.c:693
>>>> (/wrkdirs/usr/ports/lang/ghc/work/ghc-8.8.3/rts/xxhash.c:693)
>>>> >>>            RTS.o:(.text.XXH64+0x0) in archive
>>>> /usr/local/lib/ghc-8.8.3/rts/libHSrts.a
>>>>
>>>> ...
>>>>
>>>> I am using GHC version 8.8.3_1 and cabal-install 3.0 installed by 'sudo
>>>> pkg install ...'
>>>>
>>>> (I was trying to run cabal install language-dickinson)
>>>>
>>>> Cheers,
>>>> Vanessa McHale
>>>>
>>>>
>>>> _______________________________________________
>>>> Haskell-Cafe mailing list
>>>> To (un)subscribe, modify options or view archives go to:
>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>>>> Only members subscribed via the mailman list are allowed to post.
>>>
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> To (un)subscribe, modify options or view archives go to:
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>>> Only members subscribed via the mailman list are allowed to post.
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.
>


--
brandon s allbery kf8nh
[hidden email]

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.