Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dash not buildable with -static under debian #437

Closed
scratchy opened this issue Jul 17, 2015 · 8 comments
Closed

Dash not buildable with -static under debian #437

scratchy opened this issue Jul 17, 2015 · 8 comments

Comments

@scratchy
Copy link

Hey,

Got trouble building dash under debian 7.8 / 8.1. Only checked v12 dunno hows it with v11

Im running

./autoconf
./configure --with-incompatible-bdb LDFLAGS="-static"

and i get following error:

checking for SSL... yes
checking for CRYPTO... yes
checking for RAND_egd in -lcrypto... no
configure: error: Detected LibreSSL: This is NOT supported, and may break consensus compatibility!

Any idears how to solve this? libssl-dev is installed ~

@UdjinM6
Copy link

UdjinM6 commented Jul 18, 2015

try --with-libressl
pls be aware of side effects bitcoin#6244

@scratchy
Copy link
Author

Hey,

Thanks this did somehow the trick at least it build the dashd/cli now.

Anyways there are two issues:

First it seems on the current git version the tests are not able to build:

  CXX      test/test_test_dash-util_tests.o
  CXX      test/test_test_dash-accounting_tests.o
  CXX      test/test_test_dash-wallet_tests.o
  CXX      test/test_test_dash-rpc_wallet_tests.o
  CXXLD    libbitcoinconsensus.la
  AR       univalue/libbitcoin_univalue.a
  AR       libbitcoin_util.a
  CXXLD    dashd
  CXXLD    dash-cli
  CXXLD    dash-tx
  CXXLD    test/test_dash
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Makefile:2762: recipe for target 'test/test_dash' failed
make[2]: *** [test/test_dash] Error 1
make[2]: Leaving directory '/root/dash-builder/tdash/src'
Makefile:6856: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/dash-builder/tdash/src'
Makefile:557: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

i used:

git checkout v0.12.0.x && \
git reset HEAD --hard && \
./autogen.sh && \
./configure --with-incompatible-bdb LDFLAGS="-static" --with-libressl --enable-static && \
make -j 2

to build it.

The second issue is that it doesnt even build the static version of the dashd/cli:

# file tdash/src/dashd
tdash/src/dashd: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=4cc1c4dc7efd4215f8fdda94f64ac152a9770681, stripped
# file tdash/src/dash-cli
tdash/src/dash-cli: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=e825892444e537cda9b4ed73b619423990c362fd, stripped

so its still dynamically linked and idears?

@UdjinM6
Copy link

UdjinM6 commented Jul 19, 2015

Try disabling tests compilation --enable-tests=no

Not sure about static. @schinzelh any idea?

@scratchy
Copy link
Author

enable-tests=no did not solve it at all.
Tried a bit around but its not working :(

@schinzelh
Copy link

What's the rationale of having a "fully statically linked" binary? Usually you still link some libraries dynamically even if you are doing a static build, as the static linking of e.g, libc and qt is discouraged.

See bitcoin#3781 for further reference

@schinzelh
Copy link

Anyway, in case you just want a "working binary" for your Debian, did you try
--enable-glibc-back-compat ?

https://github.com/bitcoin/bitcoin/pull/4042/files

@scratchy
Copy link
Author

The reason is the normal use-case like for every static binary:
Full portability without dependencies on the running systems. Even if the ram/space usage is a bit higher then normal.

Im using for example different versions of debian (wheezy,jessie) each of them have different libdb,libboost etc. I dont want to build the binary on each system, so i setup a build server for exactly this reason.
Now i dont want to build binarys für each constellation. I dont mind about the QT-stuff since im only using the daemon.

Overall: i got running binarys, currently im building them for each system. But in future i would like to have a static way so its portable between them~

Edit: Okay the trouble is because the "libnss_files"-library is not possible to build in a static version. This prevents a 'full' static build..

@schinzelh
Copy link

Obsolete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants