From owner-freebsd-toolchain@freebsd.org Sat Oct 6 19:42:32 2018 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0637310C487E for ; Sat, 6 Oct 2018 19:42:32 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-20.consmr.mail.gq1.yahoo.com (sonic313-20.consmr.mail.gq1.yahoo.com [98.137.65.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8763A80FFC for ; Sat, 6 Oct 2018 19:42:31 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: vLtscRgVM1k29rImfuaGZOLNamqT0.Z44G.DytqjVZ2FR6GjTQIM1bX.bsIc0dk 35u3SUZVqnhuCl6yCQFnwqQyJ8RwibLXc1a_Ui3itOIj0oDahCFZQJOUG1MCrdVB0EgFvpL_AD.Q 7iMJcLxnXvJe9OJAP2nJurlC_1RhCaWnTkvL1I3KYbHiKAdy2caJOSLwoTx.gevQ6hbt2N1dOveG eTI8X9ewTD6q8jSwNY_rlxzCwGqi.Ju716obsGBQDvLwtXHArgM5l77XX96AfJQJt6CbJazhTGun Ad1qFYXdP0w5G_bhN45.fpIN_1epz1RqymzKXQ2bp1Gk_7.BryBr_wG2Prdj0pUoHiuBOwXZYtpn TfhbKM2VKNDMnQ7zoFL99vbjxmcse88tuh_x5pmqbgeKOGcwevwHV9ignlnGjZBmUXpv4NHds6qz YMqFNsk0LyrUIN6p.ldwlz9dPlcphAlehDnTiYoQSqb72.MumqD3iORvuocRmHteXkZtRVELyOu8 Pzo2VJqa0pj_sMTMr6x83rzTfC_jmtGL1ilZ6Wf4qqPY0A8cF2_VoQZONHbxOxQcmhSioXI4BO9j DjYAd_.eYWYzKmmwZTf5lwbVdz2iMG94X_4kmfLNdjSMeAQ_DKKTmh0QnlJPAOA0IZnfyuXqK8t5 COnjgVLBqIqczGyEXEfRyUBTK63ZNJ27Z0WAM5obDaMjLIybQlvWfHUff3XDJti6dPr3DOytct3P EKZ_OoEX0GKoKAR1U1lujkrqHjKy9t38Qrrgm_.aRbNZ9qgl7f2IVWX5HeYE.lVhiEUA95LslgRI gvCZ12s5dlirMdTWeQqhoZkjw1nxsoY2RNqVgbVWpNOQRNQcdZkNWvG37_WKIADosvrPG5MUWklB KYnrPvzSNiWuvAFijz6Hb.Xyl0UeHYHOlLtxE9fABIThhQH94kmfuEkW.Fab895m3al0LuQ7caKE PkrIyD2y1E8mCqIJGtQ9ajS9CkFbid0dyYlroLXpHkwyvRgkTJpSiXm9im49DW4MPmjY6eCuHYoL q0Cc1xNf1f.Gn2yWXXrvjRfjbb.OcIH0vJndIgoZMDDwEJpVhtJulzmOElpAUtBVCs.U- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Sat, 6 Oct 2018 19:42:30 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.101]) ([76.115.7.162]) by smtp426.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 3b05b74320b694923ebd026ecb983173; Sat, 06 Oct 2018 19:22:13 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: base/binutils vs. /usr/local/lib references and also: undefined reference to `pthread_create' (powerpc64 targeting example) Date: Sat, 6 Oct 2018 12:22:12 -0700 References: <4C338B84-1179-4569-A964-CA18A22AF1D7@yahoo.com> To: FreeBSD Toolchain , FreeBSD PowerPC ML In-Reply-To: <4C338B84-1179-4569-A964-CA18A22AF1D7@yahoo.com> Message-Id: X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Oct 2018 19:42:32 -0000 [Actually devel/gettext-tools is a build time dependency: it should not = be using libtool: link: /usr/local/bin/powerpc64-unknown-freebsd12.0-gcc = --sysroot=3D. . . It looks like the /usr/local/lib references are correct but the wrong = linker was being used. About 5 other ports have a similar status for making = base/binutils as a cross build.] On 2018-Oct-5, at 11:00 PM, Mark Millard wrote: > In trying to follow the base/binutils part of = https://wiki.freebsd.org/ExternalGCC > (or /usr/ports/base/README) for targeting powerpc64 I got: >=20 > ( My /etc/make.conf has: WRKDIRPREFIX?=3D/wrkdirs .) >=20 > # cd ../../base/binutils/ > # make CROSS_TOOLCHAIN=3Dpowerpc64-gcc = CROSS_SYSROOT=3D/usr/obj/DESTDIRs/xtcgcc-powerpc64-installworld package > . . . Note: This should involve building devel/gettext-tools targetting amd64 (the host environment in this example) because devel/gettext-tools is a build-time dependency, not to be run on the target system. > --- recode-sr-latin --- > /bin/sh ../libtool --tag=3DCC --mode=3Dlink = /usr/local/bin/powerpc64-unknown-freebsd12.0-gcc = --sysroot=3D/usr/obj/DESTDIRs/xtcgcc-powerpc64-installworld -O2 -pipe = -DLIBICONV_PLUG -g -fno-strict-aliasing -o recode-sr-latin = recode_sr_latin-recode-sr-latin.o recode_sr_latin-filter-sr-latin.o = ../gnulib-lib/libgettextlib.la ../intl/libintl.la -L/usr/local/lib So the following is wrong: --mode=3Dlink /usr/local/bin/powerpc64-unknown-freebsd12.0-gcc = --sysroot=3D/usr/obj/DESTDIRs/xtcgcc-powerpc64-installworld here and analogous points are later. > --- cldr_plurals-cldr-plural.o --- > . . . > --- recode-sr-latin --- > libtool: link: /usr/local/bin/powerpc64-unknown-freebsd12.0-gcc = --sysroot=3D/usr/obj/DESTDIRs/xtcgcc-powerpc64-installworld -O2 -pipe = -DLIBICONV_PLUG -g -fno-strict-aliasing -o .libs/recode-sr-latin = recode_sr_latin-recode-sr-latin.o recode_sr_latin-filter-sr-latin.o = ../gnulib-lib/.libs/libgettextlib.so = /wrkdirs/usr/ports/devel/gettext-tools/work/gettext-0.19.8.1/gettext-tools= /intl/.libs/libintl.so -L/usr/local/lib ../intl/.libs/libintl.so -lm = -lncurses -Wl,-rpath -Wl,/usr/local/lib > --- hostname --- > . . . > --- recode-sr-latin --- > = /wrkdirs/usr/ports/devel/gettext-tools/work/gettext-0.19.8.1/gettext-tools= /intl/.libs/libintl.so: undefined reference to `pthread_create' devel/gettext-tools has an option to enable/disable building for thread use, with a default of enabled. > collect2: error: ld returned 1 exit status > *** [recode-sr-latin] Error code 1 >=20 > make[16]: stopped in = /wrkdirs/usr/ports/devel/gettext-tools/work/gettext-0.19.8.1/gettext-tools= /src >=20 >=20 > The use of -L/usr/local/lib and -Wl,-rpath -Wl,/usr/local/lib look > suspect for such cross builds: >=20 > # ls /usr/obj/DESTDIRs/xtcgcc-powerpc64-installworld/usr/local/lib/ > ls: /usr/obj/DESTDIRs/xtcgcc-powerpc64-installworld/usr/local/lib/: No = such file or directory I went the wrong direction with this: it should not be a powerpc64 targeted operation and so /usr/local/lib appears to be a correct aspect. > Then there is also: undefined reference to `pthread_create'. Is there > a missing -pthread or some such? (Or is the /usr/local/lib reference > a cause?) [FYI: The earlier pkg build seem to have worked.] This sort of aspect might still apply. > Looks like this way of getting to 12 or later for powerpc64 without > use of gcc 4.2.1 is currently blocked. (The issue may not be limited > to powerpc64.) May be if devel/gettext-tools had been pre-built and installed before trying the CROSS_TOOLCHAIN=3Dpowerpc64-gcc CROSS_SYSROOT=3D/usr/obj/DESTDIRs/xtcgcc-powerpc64-installworld based build activity it would have been okay? [I try such later below and report on the results.] There are no words on https://wiki.freebsd.org/ExternalGCC or in /usr/ports/base/README for such special build-sequence instructions. > (It is also unclear how the process involving base/* mixes with doing > later FreeBSD updates from source --including any use of a delete-old > step if WITHOUT_BINUTILS=3D is used at the time. For the cross = buildworld > itself it is not clear what options are intended.) >=20 >=20 >=20 > Notes about some typos on: https://wiki.freebsd.org/ExternalGCC >=20 > /usr/ports/devel/ports-mgmt/pkg should be: > /usr/ports/ports-mgmt/pkg >=20 > 3 examples of CROSS_TOOCLAHIN should be: > CROSS_TOOLCHAIN >=20 >=20 > Notes about the /usr/ports/base/README : >=20 > No mention is made of the pkg build so that it can be > set up on the target. Only https://wiki.freebsd.org/ExternalGCC > has that information. /usr/ports/base/README does not > reference https://wiki.freebsd.org/ExternalGCC either. There may be more material needed on one or both of https://wiki.freebsd.org/ExternalGCC and/or /usr/ports/base/README for the likes of how/when things like devel/gettext-tools should be built vs. when CROSS_TOOLCHAIN=3D. . . CROSS_SYSROOT=3D . . . builds build steps should be done. There may be more material needed about the build options to use for various steps, such as if devel/gettext-tools should have threading enabled vs. disabled. The following seem to have a similar status to devel/gettext-tools: math/gmp math/mpfr devel/bison devel/m4 (indirectly via devel/bison) devel/gmake devel/gettext-tools (just for list completeness)=20 in that each is a build dependency for devel/binutils variants, such as base/binutils . With those 6 ports pre-installed as host non-cross-build material (amd64 here) the cross build/package of base/binutils worked, given that it was not already installed as host material. [In thinking about it I think I made similar notes and sent them out on the lists long ago. base/* have improved much since then: I reported a lot more then as well that does not apply now.] =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)