# LDFLAGS=-Wl,--as-needed emerge encfs [...] /bin/sh ../libtool --tag=CXX --mode=link x86_64-pc-linux-gnu-g++ -DRLOG_COMPONENT="encfs" -I/usr/kerberos/include -I/usr/include -DLOCALEDIR=\"/usr/share/locale\" -W -Wall -Wpointer-arith -Wwrite-strings -march=native -O2 -pipe -pthread -version-info 5:0:1 -Wl,--as-needed -Wl,-O1 -o libencfs.la -rpath /usr/lib64 readpassphrase.lo base64.lo ConfigReader.lo ConfigVar.lo Context.lo Cipher.lo CipherKey.lo FileIO.lo RawFileIO.lo BlockFileIO.lo CipherFileIO.lo MACFileIO.lo NameIO.lo StreamNameIO.lo BlockNameIO.lo NullNameIO.lo Interface.lo MemoryPool.lo NullCipher.lo DirNode.lo FileNode.lo FileUtils.lo openssl.lo autosprintf.lo SSL_Cipher.lo -lrlog x86_64-pc-linux-gnu-g++ -shared -nostdlib /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/crtbeginS.o .libs/readpassphrase.o .libs/base64.o .libs/ConfigReader.o .libs/ConfigVar.o .libs/Context.o .libs/Cipher.o .libs/CipherKey.o .libs/FileIO.o .libs/RawFileIO.o .libs/BlockFileIO.o .libs/CipherFileIO.o .libs/MACFileIO.o .libs/NameIO.o .libs/StreamNameIO.o .libs/BlockNameIO.o .libs/NullNameIO.o .libs/Interface.o .libs/MemoryPool.o .libs/NullCipher.o .libs/DirNode.o .libs/FileNode.o .libs/FileUtils.o .libs/openssl.o .libs/autosprintf.o .libs/SSL_Cipher.o /usr/lib64/librlog.so -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/crtn.o -march=native -pthread -Wl,--as-needed -Wl,-O1 -Wl,-soname -Wl,libencfs.so.4 -o .libs/libencfs.so.4.1.0 (cd .libs && rm -f libencfs.so.4 && ln -s libencfs.so.4.1.0 libencfs.so.4) (cd .libs && rm -f libencfs.so && ln -s libencfs.so.4.1.0 libencfs.so) creating libencfs.la (cd .libs && rm -f libencfs.la && ln -s ../libencfs.la libencfs.la) x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -I../intl -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -D__STDC_FORMAT_MACROS -DRLOG_COMPONENT="encfs" -I/usr/kerberos/include -I/usr/include -DLOCALEDIR=\"/usr/share/locale\" -W -Wall -Wpointer-arith -Wwrite-strings -march=native -O2 -pipe -pthread -MT encfs.o -MD -MP -MF .deps/encfs.Tpo -c -o encfs.o encfs.cpp mv -f .deps/encfs.Tpo .deps/encfs.Po x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -I../intl -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -D__STDC_FORMAT_MACROS -DRLOG_COMPONENT="encfs" -I/usr/kerberos/include -I/usr/include -DLOCALEDIR=\"/usr/share/locale\" -W -Wall -Wpointer-arith -Wwrite-strings -march=native -O2 -pipe -pthread -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp mv -f .deps/main.Tpo .deps/main.Po /bin/sh ../libtool --tag=CXX --mode=link x86_64-pc-linux-gnu-g++ -DRLOG_COMPONENT="encfs" -I/usr/kerberos/include -I/usr/include -DLOCALEDIR=\"/usr/share/locale\" -W -Wall -Wpointer-arith -Wwrite-strings -march=native -O2 -pipe -pthread -Wl,--as-needed -Wl,-O1 -o encfs encfs.o main.o libencfs.la -lrlog -lssl -lcrypto -ldl -lfuse -lboost_serialization-mt-s -lboost_filesystem-mt-s -lboost_system-mt-s x86_64-pc-linux-gnu-g++ -DRLOG_COMPONENT=encfs -I/usr/kerberos/include -I/usr/include -DLOCALEDIR=\"/usr/share/locale\" -W -Wall -Wpointer-arith -Wwrite-strings -march=native -O2 -pipe -pthread -Wl,--as-needed -Wl,-O1 -o .libs/encfs encfs.o main.o ./.libs/libencfs.so /usr/lib64/librlog.so -lssl -lcrypto -ldl /usr/lib64/libfuse.so -lboost_serialization-mt-s -lboost_filesystem-mt-s -lboost_system-mt-s ./.libs/libencfs.so: undefined reference to `HMAC_CTX_init' ./.libs/libencfs.so: undefined reference to `EVP_CIPHER_CTX_block_size' ./.libs/libencfs.so: undefined reference to `ENGINE_register_all_complete' ./.libs/libencfs.so: undefined reference to `EVP_CIPHER_iv_length' ./.libs/libencfs.so: undefined reference to `EVP_aes_192_cbc' ./.libs/libencfs.so: undefined reference to `CRYPTO_set_locking_callback' ./.libs/libencfs.so: undefined reference to `EVP_CIPHER_CTX_init' ./.libs/libencfs.so: undefined reference to `SSL_load_error_strings' ./.libs/libencfs.so: undefined reference to `HMAC_Update' ./.libs/libencfs.so: undefined reference to `OPENSSL_cleanse' ./.libs/libencfs.so: undefined reference to `EVP_bf_cbc' ./.libs/libencfs.so: undefined reference to `CRYPTO_malloc' ./.libs/libencfs.so: undefined reference to `EVP_CIPHER_block_size' ./.libs/libencfs.so: undefined reference to `EVP_aes_192_cfb128' ./.libs/libencfs.so: undefined reference to `BUF_MEM_new' ./.libs/libencfs.so: undefined reference to `HMAC_Final' ./.libs/libencfs.so: undefined reference to `ENGINE_cleanup' ./.libs/libencfs.so: undefined reference to `CRYPTO_free' ./.libs/libencfs.so: undefined reference to `BUF_MEM_grow' ./.libs/libencfs.so: undefined reference to `EVP_DecryptFinal_ex' ./.libs/libencfs.so: undefined reference to `HMAC_Init_ex' ./.libs/libencfs.so: undefined reference to `RAND_bytes' ./.libs/libencfs.so: undefined reference to `EVP_MD_CTX_cleanup' ./.libs/libencfs.so: undefined reference to `EVP_CIPHER_CTX_cleanup' ./.libs/libencfs.so: undefined reference to `CRYPTO_num_locks' ./.libs/libencfs.so: undefined reference to `HMAC_CTX_cleanup' ./.libs/libencfs.so: undefined reference to `EVP_aes_256_cbc' ./.libs/libencfs.so: undefined reference to `EVP_DecryptInit_ex' ./.libs/libencfs.so: undefined reference to `ERR_get_error' ./.libs/libencfs.so: undefined reference to `EVP_CIPHER_CTX_set_padding' ./.libs/libencfs.so: undefined reference to `PKCS5_PBKDF2_HMAC_SHA1' ./.libs/libencfs.so: undefined reference to `ERR_error_string' ./.libs/libencfs.so: undefined reference to `SSL_library_init' ./.libs/libencfs.so: undefined reference to `EVP_aes_256_cfb128' ./.libs/libencfs.so: undefined reference to `CRYPTO_set_id_callback' ./.libs/libencfs.so: undefined reference to `RAND_pseudo_bytes' ./.libs/libencfs.so: undefined reference to `BUF_MEM_free' ./.libs/libencfs.so: undefined reference to `EVP_bf_cfb64' ./.libs/libencfs.so: undefined reference to `EVP_DecryptUpdate' ./.libs/libencfs.so: undefined reference to `EVP_EncryptFinal_ex' ./.libs/libencfs.so: undefined reference to `EVP_MD_CTX_init' ./.libs/libencfs.so: undefined reference to `EVP_EncryptInit_ex' ./.libs/libencfs.so: undefined reference to `EVP_aes_128_cfb128' ./.libs/libencfs.so: undefined reference to `EVP_EncryptUpdate' ./.libs/libencfs.so: undefined reference to `EVP_CIPHER_key_length' ./.libs/libencfs.so: undefined reference to `EVP_DigestInit_ex' ./.libs/libencfs.so: undefined reference to `EVP_DigestFinal_ex' ./.libs/libencfs.so: undefined reference to `EVP_aes_128_cbc' ./.libs/libencfs.so: undefined reference to `ENGINE_load_builtin_engines' ./.libs/libencfs.so: undefined reference to `EVP_BytesToKey' ./.libs/libencfs.so: undefined reference to `EVP_CIPHER_CTX_set_key_length' ./.libs/libencfs.so: undefined reference to `EVP_sha1' ./.libs/libencfs.so: undefined reference to `EVP_DigestUpdate' collect2: ld returned 1 exit status make[2]: *** [encfs] Error 1 make[2]: Leaving directory `/var/tmp/portage/sys-fs/encfs-1.5/work/encfs-1.5/encfs' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/sys-fs/encfs-1.5/work/encfs-1.5' make: *** [all] Error 2 * * ERROR: sys-fs/encfs-1.5 failed.
Created attachment 170880 [details, diff] encfs-1.5-as-needed.patch Patch to build encfs.so correctly. Note that because encfs-1.5-boost-system.patch modifies Makefile.in instead of Makefile.am (why??), I also have to modify Makefile.in instead of Makefile.am in my patch.
Alex, Short answer: I let it pass, my fault. Does it work ok with Makefile.am? Can you provide a new patch? Cheers, Marcelo
Created attachment 171206 [details, diff] patch for Makefile.am (In reply to comment #2) Here is a combined patch for Makefile.am that allows building with --as-needed and additionally fixes the BOOST_SYSTEM_LIB issue that encfs-1.5-boost-system.patch was written to fix.
In cvs, thanks!
-ALL_LDFLAGS += @BOOST_SERIALIZATION_LIB@ @BOOST_FILESYSTEM_LIB@ +ALL_LDFLAGS += @BOOST_SERIALIZATION_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_SYSTEM_LIB@ This is not good, libraries should _never_ go to LDFLAGS.
(In reply to comment #5) > This is not good, libraries should _never_ go to LDFLAGS. If I am reading the encfs Makefile.am correctly, the variable ALL_LDFLAGS is not actually used as LDFLAGS anywhere - it is only used to set various *_LDADD variables later on. So I think the code is correct, but the choice of variable names is not very good. Of course, I am not an automake expert...
Created attachment 173626 [details, diff] patch for the ebuild Well, the main problem was that I was still experiencing the problems with both ssl and boost symbols with --as-needed and even without --as-needed there were problem with the boost symbols. So I discussed it with the autotools expert :) and then he reopened with the comment, which might be invalid as you say (dunno). I'm also not expert, but it seems that the Makefile.in is not regenerated from the Makefile.am so the patch does not get applied in the end. Build output might give a hint: make[2]: Entering directory `/var/tmp/portage/sys-fs/encfs-1.5/work/encfs-1.5/encfs' cd .. && /bin/sh /var/tmp/portage/sys-fs/encfs-1.5/work/encfs-1.5/missing --run automake-1.10 --gnu encfs/Makefile aclocal.m4:16: warning: this file was generated for autoconf 2.61. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'. configure.ac:4: version mismatch. This is Automake 1.10.2, configure.ac:4: but the definition used by this AM_INIT_AUTOMAKE configure.ac:4: comes from Automake 1.10.1. You should recreate configure.ac:4: aclocal.m4 with aclocal and run automake again. WARNING: `automake-1.10' is probably too old. You should only need it if you modified `Makefile.am', `acinclude.m4' or `configure.ac'. You might want to install the `Automake' and `Perl' packages. Grab them from any GNU archive site. So it seems that the build system itself calls automake to update the Makefile.in (Diego called this "evil maintainer-mode" or something) but apparently fails. After Diego's advice I patched the ebuild as attached. And the eclass magic seems to fix it :) * Automake used for the package (1.10.1) differs from * the installed version (1.10.2). * Running eautoreconf in '/var/tmp/portage/sys-fs/encfs-1.5/work/encfs-1.5' ... * Running aclocal -I m4 -I m4-local ... [ ok ] * Running libtoolize --copy --force --install --automake ... [ ok ] * Running aclocal -I m4 -I m4-local ... [ ok ] * Running autoconf ... [ ok ] * Running autoheader ... [ ok ] * Running automake --add-missing --copy --foreign ... [ ok ] * Running elibtoolize in: encfs-1.5 And then it compiles fine (with --as-needed). So hopefully that's the solution.
Added Caster's patch to cvs. Please reopen if still an issue. @ Caster: feel free to commit any changes you may have.