Date: Sun, 29 Nov 2015 22:11:04 -0800 From: Mark Millard <markmi@dsl-only.net> To: FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org> Subject: 11.0-CURRENT powerpc64 cont'd: without adding to LIBADD linking various programs are getting undefined references Message-ID: <693DFA8E-B19B-44E9-A0E7-C42B5DB7025B@dsl-only.net> In-Reply-To: <8AF435C1-9F0B-4466-9210-A54D7210B30C@dsl-only.net> References: <01BA3FF2-F362-48FA-B9E2-112E05CC00ED@dsl-only.net> <6AA244B9-DE60-4D8B-A08E-AADD73F9D856@dsl-only.net> <106D9CB0-D9AE-4463-A03E-3AB16583CDA7@dsl-only.net> <E507F9AF-2818-4E6D-9538-A8670B079C8A@dsl-only.net> <8AF435C1-9F0B-4466-9210-A54D7210B30C@dsl-only.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Note: After the below examples rescue had a much larger list of = Undefined References from various sources. At least for now I've given = up and not tried to track down what to add to get rescue to link. Explicit md references were used to avoid symbol problems in: /usr/src/cddl/sbin/zfs/Makefile /usr/src/cddl/sbin/zpool/Makefile /usr/src/cddl/usr.bin/zinject/Makefile /usr/src/cddl/usr.bin/zstreamdump/Makefile /usr/src/cddl/usr.bin/ztest/Makefile /usr/src/cddl/usr.sbin/zdb/Makefile /usr/src/cddl/usr.sbin/zhack/Makefile (A separate submittal covered the first few of those in more detail.) libcrypto use had similar issues, for example: > Index: /usr/src/sbin/atm/atmconfig/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /usr/src/sbin/atm/atmconfig/Makefile (revision 291443) > +++ /usr/src/sbin/atm/atmconfig/Makefile (working copy) > @@ -17,7 +17,7 @@ > .if !defined(RESCUE) && ${MK_BSNMP} !=3D "no" > CFLAGS+=3D -DWITH_BSNMP > SRCS+=3D oid.h atmconfig_device.c > -LIBADD+=3D bsnmp > +LIBADD+=3D crypto bsnmp > . if ${MK_DYNAMICROOT} =3D=3D "no" && ${MK_OPENSSL} !=3D "no" > LIBADD+=3D crypto > . endif Without the addition the result was: > --- all_subdir_sbin --- > /usr/local/bin/powerpc64-portbld-freebsd11.0-gcc -O2 -pipe -isystem = /usr/obj/usr/src/tmp/usr/include/. -L/usr/obj/usr/src/tmp/usr/lib/. = -L/usr/obj/usr/src/tmp/li > b/. -I/usr/obj/usr/src/sbin/atm/atmconfig -DWITH_BSNMP -g -std=3Dgnu99 = -fstack-protector-strong -Wsystem-headers -Wall -Wno-format-y2k -W = -Wno-unused-parameter -Ws > trict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type = -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter = -Wcast-align -Wchar-subscrip > ts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition = -Wno-pointer-sign -L/usr/obj/usr/src/tmp/usr/lib/. = -L/usr/obj/usr/src/tmp/lib/. -L/usr/obj > /usr/src/lib/libc++/. -L/usr/lib/. -o atmconfig.full main.o diag.o = natm.o atmconfig_device.o -lbsnmp . . . > --- all_subdir_sbin --- > /usr/local/bin/powerpc64-freebsd-ld: warning: libcrypto.so.8, needed = by /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so, not found (try using = -rpath or -rpath-link) > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_md5' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_sha1' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_DecryptInit' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_DigestInit' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_EncryptFinal' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_EncryptUpdate' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_DigestUpdate' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_CIPHER_CTX_set_padding' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_DigestFinal' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_DecryptFinal' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_aes_128_cfb128' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_DecryptUpdate' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_des_cbc' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_EncryptInit' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_MD_CTX_cleanup' > /usr/obj/usr/src/tmp/usr/lib/./libbsnmp.so: undefined reference to = `EVP_CIPHER_CTX_cleanup' > collect2: error: ld returned 1 exit status > *** [atmconfig.full] Error code 1 The -L's ending with /.'s are from my /etc/src.conf . They are = associated with trying to self-build on a powerpc64 PowerMac using only = powerpc64-xtoolchain-gcc's powerpc64-gcc WITH_LIBCPLUSPLUS: = powerpc64-gcc is acting as both the host toolchain and the = CROSS_TOOLCHAIN. No 4.2.1 gcc is present. I know this is not a usual way = of doing things. There may be better ways. But if I manage to expose = some missing dependency tracking some good came of it. And there was the need to add sbuf explicitly for its indirect use, such = as for: > Index: /usr/src/sbin/iscontrol/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /usr/src/sbin/iscontrol/Makefile (revision 291443) > +++ /usr/src/sbin/iscontrol/Makefile (working copy) > @@ -2,7 +2,7 @@ > =20 > SRCS=3D iscontrol.c pdu.c fsm.c config.c login.c auth_subr.c misc.c > PROG=3D iscontrol > -LIBADD=3D cam md > +LIBADD=3D sbuf cam md > S=3D ${.CURDIR}/../../sys > =20 > WARNS?=3D 3 Otherwise I got: > /usr/local/bin/powerpc64-portbld-freebsd11.0-gcc -O2 -pipe -isystem = /usr/obj/usr/src/tmp/usr/include/. -L/usr/obj/usr/src/tmp/usr/lib/. = -L/usr/obj/usr/src/tmp/li > b/. -I/usr/src/sbin/iscontrol/../../sys -g -std=3Dgnu99 = -fstack-protector-strong -Wsystem-headers -Wall -Wno-format-y2k -W = -Wno-unused-parameter -Wstrict-prototype > s -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized = -Wno-pointer-sign -L/usr/obj/usr/src/tmp/usr/lib/. = -L/usr/obj/usr/src/tmp/lib/. -L/usr/obj/usr/src/lib > /libc++/. -L/usr/lib/. -o iscontrol.full iscontrol.o pdu.o fsm.o = config.o login.o auth_subr.o misc.o -lcam -lmd . . . > --- all_subdir_sbin --- > /usr/obj/usr/src/tmp/usr/lib/./libcam.so: undefined reference to = `sbuf_hexdump@FBSD_1.4' > collect2: error: ld returned 1 exit status Then there was both ssl and crypto for fetch: > Index: /usr/src/usr.bin/fetch/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /usr/src/usr.bin/fetch/Makefile (revision 291443) > +++ /usr/src/usr.bin/fetch/Makefile (working copy) > @@ -2,6 +2,6 @@ > =20 > PROG=3D fetch > CSTD?=3D c99 > -LIBADD=3D fetch > +LIBADD=3D ssl crypto fetch > =20 > .include <bsd.prog.mk> without which I got: > --- all_subdir_usr.bin --- > /usr/local/bin/powerpc64-portbld-freebsd11.0-gcc -O2 -pipe -isystem = /usr/obj/usr/src/tmp/usr/include/. -L/usr/obj/usr/src/tmp/usr/lib/. = -L/usr/obj/usr/src/tmp/li > b/. -g -std=3Diso9899:1999 -fstack-protector-strong -Wsystem-headers = -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes = -Wmissing-prototypes -Wpoin > ter-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow = -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline = -Wnested-externs -Wredundant-dec > ls -Wold-style-definition -Wno-pointer-sign = -L/usr/obj/usr/src/tmp/usr/lib/. -L/usr/obj/usr/src/tmp/lib/. = -L/usr/obj/usr/src/lib/libc++/. -L/usr/lib/. -o fetch. > full fetch.o -lfetch . . . > --- all_subdir_usr.bin --- > /usr/local/bin/powerpc64-freebsd-ld: warning: libssl.so.8, needed by = /usr/obj/usr/src/tmp/usr/lib/./libfetch.so, not found (try using -rpath = or -rpath-link) > /usr/local/bin/powerpc64-freebsd-ld: warning: libcrypto.so.8, needed = by /usr/obj/usr/src/tmp/usr/lib/./libfetch.so, not found (try using = -rpath or -rpath-link) > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_LOOKUP_file' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `ASN1_STRING_length' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_get_error' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `CRYPTO_free' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_write' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSLv23_client_method' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `sk_value' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `MD5_Final' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_free' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_STORE_add_lookup' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_CTX_use_certificate_chain_file' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_set_fd' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_NAME_ENTRY_get_data' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_CTX_set_verify' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_NAME_oneline' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `ASN1_STRING_data' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_get_subject_name' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_get_issuer_name' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_get_version' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_library_init' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_read' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_STORE_CTX_get_current_cert' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_get_current_cipher' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_CTX_ctrl' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_new' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_set_connect_state' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_shutdown' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `GENERAL_NAMES_free' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_CTX_new' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_get_peer_certificate' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_NAME_get_entry' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_CTX_load_verify_locations' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_get_ext_d2i' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_load_crl_file' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_ctrl' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_STORE_set_flags' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_CTX_use_PrivateKey_file' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_free' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `X509_NAME_get_index_by_NID' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `sk_num' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_connect' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_CTX_free' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_load_error_strings' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_CTX_get_cert_store' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `MD5_Init' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `SSL_CIPHER_get_name' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `ERR_print_errors_fp' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `MD5_Update' > /usr/obj/usr/src/tmp/usr/lib/./libfetch.so: undefined reference to = `ASN1_STRING_to_UTF8' > collect2: error: ld returned 1 exit status The make commands were: > make -j 6 -DNO_CLEAN WITH_FAST_DEPEND=3D CROSS_TOOLCHAIN=3Dpowerpc64-gcc= WITH_LIBCPLUSPLUS=3D WITHOUT_CLANG_BOOTSTRAP=3D WITH_CLANG=3D = WITH_CLANG_IS_CC=3D WITH_LLDB=3D WITHOUT_GCC_BOOTSTRAP=3D WITHOUT_GCC=3D = WITHOUT_GNUCXX=3D WITHOUT_BOOT=3D WITHOUT_LIB32=3D buildworld = buildkernel KERNCONF=3DGENERIC64vtsc-NODEBUG TARGET=3Dpowerpc = TARGET_ARCH=3Dpowerpc64 (The NO_CLEAN is from after the first build problem and is to avoid long = rebuild times to get back to the same point.) Context details if you care: > # freebsd-version -ku; uname -aKU > 11.0-CURRENT > 11.0-CURRENT > FreeBSD FBSDG5C0 11.0-CURRENT FreeBSD 11.0-CURRENT #12 r281630M: Sat = Apr 18 01:15:13 PDT 2015 = root@FBSDG5C0:/usr/obj/usr/src/sys/GENERIC64vtsc-NODEBUG powerpc = 1100070 1100070 I am attempting an update after having been away from the PowerMacs for = months. > # svnlite info /usr/src > Path: /usr/src > Working Copy Root Path: /usr/src > URL: https://svn0.us-west.freebsd.org/base/head > Relative URL: ^/head > Repository Root: https://svn0.us-west.freebsd.org/base > Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f > Revision: 291443 > Node Kind: directory > Schedule: normal > Last Changed Author: nwhitehorn > Last Changed Rev: 291442 > Last Changed Date: 2015-11-28 23:16:08 -0800 (Sat, 28 Nov 2015) > # more /etc/src.conf > NO_WERROR=3D > WITH_DEBUG=3D > WITH_DEBUG_FILES=3D > MALLOC_PRODUCTION=3D > CC=3D/usr/local/bin/powerpc64-portbld-freebsd11.0-gcc > CXX=3D/usr/local/bin/powerpc64-portbld-freebsd11.0-g++ > CPP=3D/usr/local/bin/powerpc64-portbld-freebsd11.0-cpp > CROSS_BINUTILS_PREFIX=3D/usr/local/powerpc64-freebsd/bin/ > X_COMPILER_TYPE=3Dgcc > DEPFLAGS+=3D-isystem /usr/obj/usr/src/tmp/usr/include/. = -I/usr/obj/usr/src/tmp/usr/include/c++/v1/. -I/usr/include/c++/v1/. > L/usr/obj/usr/src/tmp/usr/lib/lib32/. > CFLAGS+=3D-isystem /usr/obj/usr/src/tmp/usr/include/. = -L/usr/obj/usr/src/tmp/usr/lib/. -L/usr/obj/usr/src/tmp/lib/. > LDFLAGS+=3D-L/usr/obj/usr/src/tmp/usr/lib/. = -L/usr/obj/usr/src/tmp/lib/. > CXXFLAGS+=3D-isystem /usr/obj/usr/src/tmp/usr/include/. = -I/usr/obj/usr/src/tmp/usr/include/c++/v1/. -std=3Dgnu++11 = -L/usr/obj/usr/src/lib/libc++/. > LDFLAGS+=3D-L/usr/obj/usr/src/lib/libc++/. > CXXFLAGS+=3D-I/usr/include/c++/v1/. -std=3Dgnu++11 -L/usr/lib/. > LDFLAGS+=3D-L/usr/lib/. > # svnlite info /usr/ports/ > Path: /usr/ports > Working Copy Root Path: /usr/ports > URL: https://svn0.us-west.freebsd.org/ports/head > Relative URL: ^/head > Repository Root: https://svn0.us-west.freebsd.org/ports > Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5 > Revision: 402562 > Node Kind: directory > Schedule: normal > Last Changed Author: rene > Last Changed Rev: 402562 > Last Changed Date: 2015-11-28 15:08:03 -0800 (Sat, 28 Nov 2015) =3D=3D=3D Mark Millard markmi at dsl-only.net
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?693DFA8E-B19B-44E9-A0E7-C42B5DB7025B>