From owner-freebsd-toolchain@freebsd.org Mon Nov 30 04:08:08 2015 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79832A3BF44 for ; Mon, 30 Nov 2015 04:08:08 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-151.reflexion.net [208.70.211.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39BF31EF9 for ; Mon, 30 Nov 2015 04:08:07 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 17172 invoked from network); 30 Nov 2015 04:08:03 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 30 Nov 2015 04:08:03 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Sun, 29 Nov 2015 23:08:02 -0500 (EST) Received: (qmail 13182 invoked from network); 30 Nov 2015 04:08:02 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 30 Nov 2015 04:08:02 -0000 X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 6E2E7B1E001; Sun, 29 Nov 2015 20:07:54 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: More 11.0-CURRENT: without adding -lmd linking various programs are getting undefined references From: Mark Millard In-Reply-To: Date: Sun, 29 Nov 2015 20:07:59 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <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> To: FreeBSD PowerPC ML , FreeBSD Toolchain X-Mailer: Apple Mail (2.2104) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2015 04:08:08 -0000 Without the following explicit references to (lib)md or -lmd for = programs (possibly indirectly) using libmd I get link failures during = the build, such as: /usr/obj/usr/src/tmp/usr/lib/./libulog.so: undefined reference to = `_libmd_SHA1_Init' /usr/obj/usr/src/tmp/usr/lib/./libulog.so: undefined reference to = `_libmd_SHA1_Update' /usr/obj/usr/src/tmp/usr/lib/./libulog.so: undefined reference to = `_libmd_SHA1_Final' . . . /usr/obj/usr/src/tmp/usr/lib/./libzfs.so: undefined reference to = `_libmd_SHA256_Update' /usr/obj/usr/src/tmp/usr/lib/./libzfs.so: undefined reference to = `_libmd_SHA256_Final' /usr/obj/usr/src/tmp/usr/lib/./libzfs.so: undefined reference to = `_libmd_SHA256_Init' . . . I am attempting to build for updating an 2015-Apr-18 vintage = 11.0-CURRENT, so it starts from a context back from before the renames = to use the __libdm_ prefixes on the names. So for me no implicit = bindings are being provided. Some of my temporary(?) workarounds for this are: Index: /usr/src/libexec/ulog-helper/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/libexec/ulog-helper/Makefile (revision 291443) +++ /usr/src/libexec/ulog-helper/Makefile (working copy) @@ -5,6 +5,6 @@ BINMODE=3D4555 MAN=3D =20 -LIBADD=3D ulog +LIBADD=3D ulog md Index: /usr/src/cddl/sbin/zfs/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/cddl/sbin/zfs/Makefile (revision 291443) +++ /usr/src/cddl/sbin/zfs/Makefile (working copy) @@ -24,6 +24,6 @@ =20 DPADD=3D ${LIBGEOM} ${LIBJAIL} ${LIBNVPAIR} ${LIBUMEM} \ ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} -LDADD=3D -lgeom -ljail -lnvpair -lumem -lutil -luutil -lzfs_core -lzfs +LDADD=3D -lmd -lgeom -ljail -lnvpair -lumem -lutil -luutil -lzfs_core = -lzfs =20 .include Index: /usr/src/cddl/sbin/zpool/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/cddl/sbin/zpool/Makefile (revision 291443) +++ /usr/src/cddl/sbin/zpool/Makefile (working copy) @@ -29,6 +29,6 @@ =20 DPADD=3D ${LIBAVL} ${LIBGEOM} ${LIBNVPAIR} \ ${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} -LDADD=3D -lavl -lgeom -lnvpair -lumem -lutil -luutil -lzfs_core -lzfs +LDADD=3D -lmd -lavl -lgeom -lnvpair -lumem -lutil -luutil -lzfs_core = -lzfs =20 .include Without those the results were: --- ulog-helper.full --- /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=3Dgnu99 -fstack-protector-strong -Wsystem-headers -Wall = -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes = -Wmissing-prototypes -Wpointer-ari th -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow = -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline = -Wnested-externs -Wredundant-decls -Wol d-style-definition -Wno-pointer-sign -Wformat=3D2 -Wno-format-extra-args = -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 ulog-helper.full ulog-helper.o -lulog . . . --- all_subdir_libexec --- /usr/obj/usr/src/tmp/usr/lib/./libulog.so: undefined reference to = `_libmd_SHA1_Init' /usr/obj/usr/src/tmp/usr/lib/./libulog.so: undefined reference to = `_libmd_SHA1_Update' /usr/obj/usr/src/tmp/usr/lib/./libulog.so: undefined reference to = `_libmd_SHA1_Final' collect2: error: ld returned 1 exit status . . . --- all_subdir_cddl --- /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/cddl/sbin/zfs/../../../cddl/contrib/opensolaris/lib/libzpool/co= mmon -I/usr/src/cddl/sbin/zfs/../../../cddl/compat/opensolaris/include = -I/usr/src/c ddl/sbin/zfs/../../../cddl/compat/opensolaris/lib/libumem = -I/usr/src/cddl/sbin/zfs/../../../sys/cddl/compat/opensolaris = -I/usr/src/cddl/sbin/zfs/../../../cddl/co ntrib/opensolaris/head = -I/usr/src/cddl/sbin/zfs/../../../cddl/contrib/opensolaris/lib/libuutil/co= mmon -I/usr/src/cddl/sbin/zfs/../../../cddl/contrib/opensolaris/ lib/libzfs/common = -I/usr/src/cddl/sbin/zfs/../../../cddl/contrib/opensolaris/lib/libzfs_core= /common -I/usr/src/cddl/sbin/zfs/../../../cddl/contrib/opensolaris/li b/libumem/common = -I/usr/src/cddl/sbin/zfs/../../../cddl/contrib/opensolaris/lib/libnvpair = -I/usr/src/cddl/sbin/zfs/../../../sys/cddl/contrib/opensolaris/uts/comm on = -I/usr/src/cddl/sbin/zfs/../../../sys/cddl/contrib/opensolaris/uts/common/= fs/zfs = -I/usr/src/cddl/sbin/zfs/../../../sys/cddl/contrib/opensolaris/uts/common/= sys = -I/usr/src/cddl/sbin/zfs/../../../sys/cddl/contrib/opensolaris/common/zfs = -DNEED_SOLARIS_BOOLEAN -g -std=3Dgnu99 -fstack-protector-strong = -Wno-pointer-sign -Wno-u nknown-pragmas -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 zfs.full zfs_main.o zfs_iter.o -lg eom -ljail -lnvpair -lumem -lutil -luutil -lzfs_core -lzfs . . . --- all_subdir_cddl --- /usr/obj/usr/src/tmp/usr/lib/./libzfs.so: undefined reference to = `_libmd_SHA256_Update' /usr/obj/usr/src/tmp/usr/lib/./libzfs.so: undefined reference to = `_libmd_SHA256_Final' /usr/obj/usr/src/tmp/usr/lib/./libzfs.so: undefined reference to = `_libmd_SHA256_Init' collect2: error: ld returned 1 exit status *** [zfs.full] Error code 1 . . . --- all_subdir_sbin --- ../sys/cddl/contrib/opensolaris/uts/common = -I/usr/src/cddl/sbin/zpool/../../../sys/cddl/contrib/opensolaris/uts/commo= n/fs/zfs -I/usr/src/cddl/sbin/zpool/../../.. /sys/cddl/contrib/opensolaris/uts/common/sys = -I/usr/src/cddl/sbin/zpool/../../../cddl/contrib/opensolaris/lib/libzpool/= common -I/usr/src/cddl/sbin/zpool/../../.. /cddl/contrib/opensolaris/cmd/stat/common -DNEED_SOLARIS_BOOLEAN -g = -std=3Dgnu99 -fstack-protector-strong -Wno-pointer-sign = -Wno-unknown-pragmas -L/usr/obj/usr/sr c/tmp/usr/lib/. -L/usr/obj/usr/src/tmp/lib/. = -L/usr/obj/usr/src/lib/libc++/. -L/usr/lib/. -o zpool.full zpool_main.o = zpool_vdev.o zpool_iter.o zpool_util.o zfs_c omutil.o timestamp.o -lavl -lgeom -lnvpair -lumem -lutil -luutil = -lzfs_core -lzfs . . . --- all_subdir_cddl --- /usr/obj/usr/src/tmp/usr/lib/./libzfs.so: undefined reference to = `_libmd_SHA256_Update' /usr/obj/usr/src/tmp/usr/lib/./libzfs.so: undefined reference to = `_libmd_SHA256_Final' /usr/obj/usr/src/tmp/usr/lib/./libzfs.so: undefined reference to = `_libmd_SHA256_Init' collect2: error: ld returned 1 exit status *** [zpool.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 and with 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. Another example is zinject. I'm still going through them. 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