Closed cryptozeny closed 5 years ago
restore both
CXXLD sugarchaind
CXXLD sugarchain-cli
/usr/bin/ld: crypto/libbitcoin_crypto.a(crypto_libbitcoin_crypto_a-sha256.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
crypto/libbitcoin_crypto.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:3797: recipe for target 'sugarchaind' failed
make[2]: *** [sugarchaind] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/ak/git/SUGAR/WALLET/sugarchain-v0.16.3/src'
Makefile:9593: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/ak/git/SUGAR/WALLET/sugarchain-v0.16.3/src'
Makefile:747: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
it needs anyway...
TODO:
CFLAGS
Makefile.test.include
On Tue, Feb 26, 2019 at 04:11:32AM +0900, cryptozeny cryptozeny wrote:
> ach... "-msse2" option broke ARM build FYI...
Of course. It's only valid on x86, and you only need it on 32-bit x86
(it's implied on x86-64).
> > solardiz 16 hours ago ???
> >> I recommend -O2 -fomit-frame-pointer instead of -O3, although the
> >> difference is minor (and expected to be seen mostly on 32-bit x86 builds,
> >> where you'd also want to add -msse2).
This is still valid.
> > Currently my code is like this:
> >
> > # crypto primitives library
> >> crypto_libbitcoin_crypto_a_CFLAGS = $(AM_CFLAGS) $(PIE_FLAGS) -Wall
> >> -msse2 -O2 -fomit-frame-pointer
Looks OK to me. For x86, obviously.
For other archs, just drop -msse2.
Alexander
commit https://github.com/cryptozeny/sugarchain-v0.16.3/commit/a0f145869b89d8d7f08c05199422233a58d30998#diff-ea6316674e6bb3669bd6c90366850b7bL110
https://github.com/cryptozeny/sugarchain-v0.16.3/commit/a0f145869b89d8d7f08c05199422233a58d30998#r32351643
https://github.com/cryptozeny/sugarchain-v0.16.3/commit/a0f145869b89d8d7f08c05199422233a58d30998#r32351642
https://github.com/cryptozeny/sugarchain-v0.16.3/blob/a0f145869b89d8d7f08c05199422233a58d30998/src/Makefile.am#L264
https://github.com/cryptozeny/sugarchain-v0.16.3/blob/a0f145869b89d8d7f08c05199422233a58d30998/src/Makefile.test.include#L112
if i remove these, build failed... what is this and why it needs?