[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiling on Synology



You're correct that the configure script doesn't contain any LIBRARY_PATH or
LD_LIBRARY_PATH.  Rather, some compilers examine directories like that.  For
example, gcc uses LIBRARY_PATH if it can't find a library.  (please check
"man gcc" for details)
By contrast, clang does not appear to do this, and it looks like the
recommended solution there is to pass the precise directory path with
-L/path/to/
which I see that you are already doing.

At this point, I would ignore the Tarsnap build system, and simply try to
compile a program with -lcrypto.  I'm afraid that I don't have any knowledge
about different library versions/architectures and compilers, so I can't help
with that.  If you can compile something with -lcrypto on the command-line but
not with the Tarsnap build system, then I can probably help with getting that
to work.

Sorry I can't help more,
- Graham

On Wed, Jul 27, 2016 at 10:58:56PM -0500, Justin Haynes wrote:
>    I'm still not sure what is happening here.A  I do already have these
>    exported:
>    export LDFLAGS='-Wl,-rpath=/opt/lib
>    -Wl,--dynamic-linker=/opt/lib/ld-linux-x86-64.so.2 -L/opt/lib'
>    export CFLAGS='-O2 -pipe -fomit-frame-pointer -fno-caller-saves '
>    I added these and tried again but I got the same result:
>    export LD_LIBRARY_PATH='/opt/lib'
>    export LIBRARY_PATH='/opt/lib'
>    There are mostly 64 bit libraries on the system, but there are 32 bit ones
>    as well:
>    Locate doesn't exist on this machine, but 3 libcryptos are in hints:
>    DiskStation> ldconfig -p | grep libcrypto
>    A  A  A  A  libcrypto.so.1.0.0 (libc6,x86-64) =>
>    /opt/lib/libcrypto.so.1.0.0
>    A  A  A  A  libcrypto.so.1.0.0 (libc6) => /lib/libcrypto.so.1.0.0
>    A  A  A  A  libcrypto.so (libc6) => /lib/libcrypto.so
>    DiskStation>A 
>    How can I get configure to check for the library in the correct place?A 
>    I'm digging through the configure script.A  I don't find the variables for
>    LIBRARY_PATH or LD_LIBRARY_PATH anywhere, so i'm not sure how they would
>    influence things.
>    BTW, here is what ldd says about libcrypto.A  I think that does not
>    matter, as we just want configure to verify that it has found the correct
>    libcrypto.
>    DiskStation> ldd /opt/lib/libcrypto.so.1.0.0A 
>    ldd: $warning: you do not have execution permission for
>    `/opt/lib/libcrypto.so.1.0.0'
>    A  A  A  A  linux-vdso.so.1 (0x00007fffedb11000)
>    A  A  A  A  libdl.so.2 => /opt/lib/libdl.so.2 (0x00007f0a72aeb000)
>    A  A  A  A  libc.so.6 => /opt/lib/libc.so.6 (0x00007f0a7274c000)
>    A  A  A  A  /opt/lib/ld-linux-x86-64.so.2 (0x00007f0a73139000)
>    On Wed, Jul 27, 2016 at 3:18 PM, Graham Percival <gperciva@tarsnap.com>
>    wrote:
> 
>      I see these lines in your config.log:
> 
>      configure:6048: checking for RSA_private_encrypt in -lcrypto
>      configure:6073: gcc -o conftest -O2 -pipe -fomit-frame-pointer
>      -fno-caller-savesA  A -Wl,-rpath=/opt/lib
>      -Wl,--dynamic-linker=/opt/lib/ld-linux-x86-64.so.2 -L/opt/lib conftest.c
>      -lcryptoA  -lz -lrtA  >&5
>      /opt/bin/ld: skipping incompatible /lib/libcrypto.so when searching for
>      -lcrypto
>      /opt/bin/ld: skipping incompatible /usr/lib/libcrypto.so when searching
>      for
>      -lcrypto
>      /opt/bin/ld: cannot find -lcrypto
> 
>      I'm suspicious about your header being in /opt/include , but apparently
>      either
>      /opt/lib/libcrypto* doesn't exist, or your system isn't looking there
>      for some
>      reason?A  Do you have LD_LIBRARY_PATH and/or LIBRARY_PATH set to include
>      /opt/lib ?
> 
>      I have no experience with these systems, but it looks like that warning
>      is
>      commonly used for the wrong architecture (i.e. 32-bit vs. 64-bit).A 
>      What does
>      A  A  locate libcrypto
>      give for you?A  On my ubuntu 14.04 amd64 system, I see:
>      A  A  /lib/i386-linux-gnu/libcrypto.so.1.0.0
>      A  A  /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
>      A  A  /usr/lib/i386-linux-gnu/libcrypto.so
>      A  A  /usr/lib/x86_64-linux-gnu/libcrypto.so
>      so presumably I would get the same error message if my system looked at
>      the
>      32-bit version.
> 
>      Hope this helps,
>      - Graham
> 
>      On Wed, Jul 27, 2016 at 02:50:42PM -0500, Justin Haynes wrote:
>      >A  A  List, I am also trying to compile tarsnap for use on a
>      Diskstation as the
>      >A  A  last person successfully did in this thread.AA  That person's
>      machine was
>      >A  A  Arm based.AA  Mine is x64.A
>      >A  A  Any ideas what I might try based on the following, or is there
>      any more
>      >A  A  information I should provide?
>      >A  A  > The problem is that entware-ng doesn't create some of the lib
>      symlinks
>      >
>      >A  > properly creating configure problems when compiling tarsnap.A  So
>      you need to
>      >A  > use "opkg install --force-reinstall" to reinstall openssl and
>      other packages
>      >A  > configure complains about.
>      >
>      >A  > After, compiling is simple and everything works.
>      >
>      >A  Actually, this didn't work so well for me, and I'm not sure of the
>      cause.A  I did opt to use entware-ng as Arun did, and I followed the
>      instructionsA he indicated.
>      >
>      >A  During ./configure I have an error in configuration for the OpenSSL
>      on this Diskstation DL412+, which is an x64 based machine:
>      >
>      >
>      >
>      >A  checking openssl/rsa.h usability... yes
>      >A  checking openssl/rsa.h presence... yes
>      >A  checking for openssl/rsa.h... yes
>      >A  checking for RSA_private_encrypt in -lcrypto... no
>      >A  configure: error: *** OpenSSL missing ***
>      >A  DiskStation>
>      >
>      >A  A  I suppose the following would be good to check:
>      >A  A  DiskStation> cat /opt/include/openssl/crypto.h | grep RSA
>      >A  A  A * apply to all code found in this distribution, be it the RC4,
>      RSA,
>      >A  A  # define CRYPTO_LOCK_RSA AA  AA  AA  AA  AA  AA  AA  AA  9
>      >A  A  # define CRYPTO_LOCK_RSA_BLINDING AA  AA  AA  A 25
>      >A  A  # define CRYPTO_EX_INDEX_RSA AA  AA  AA  AA  AA  AA  6
>      >A  A  DiskStation> opkg list libopenssl
>      >A  A  libopenssl - 1.0.2h-1 - The OpenSSL Project is a collaborative
>      effort to
>      >A  A  develop a robust,
>      >A  A  A commercial-grade, full-featured, and Open Source toolkit
>      implementing
>      >A  A  the Secure
>      >A  A  A Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
>      >A  A  protocols as well
>      >A  A  A as a full-strength general purpose cryptography library.
>      >A  A  A This package contains the OpenSSL shared libraries, needed by
>      other
>      >A  A  programs.
>      >A  A  DiskStation> uname -a
>      >A  A  Linux DiskStation 3.10.35 #5644 SMP Thu Nov 12 17:18:22 CST 2015
>      x86_64
>      >A  A  GNU/Linux
>      >A  A  DiskStation> pwd
>      >A  A  /volume1/scratch/source/tarsnap-autoconf-1.0.37
>      >A  A  config.log is here:
>      >A  A  http://pastebin.com/d4bw6fY7