Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Oct 2018 23:00:18 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   base/binutils vs. /usr/local/lib references and also: undefined reference to `pthread_create' (powerpc64 targeting example)
Message-ID:  <4C338B84-1179-4569-A964-CA18A22AF1D7@yahoo.com>

next in thread | raw e-mail | index | archive | help
In trying to follow the base/binutils part of =
https://wiki.freebsd.org/ExternalGCC
(or /usr/ports/base/README) for targeting powerpc64 I got:

( My /etc/make.conf has: WRKDIRPREFIX?=3D/wrkdirs .)

# cd ../../base/binutils/
# make CROSS_TOOLCHAIN=3Dpowerpc64-gcc =
CROSS_SYSROOT=3D/usr/obj/DESTDIRs/xtcgcc-powerpc64-installworld package
. . .
--- 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
--- 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'
collect2: error: ld returned 1 exit status
*** [recode-sr-latin] Error code 1

make[16]: stopped in =
/wrkdirs/usr/ports/devel/gettext-tools/work/gettext-0.19.8.1/gettext-tools=
/src


The use of -L/usr/local/lib and -Wl,-rpath -Wl,/usr/local/lib look
suspect for such cross builds:

# 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

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.]

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.)

(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.)



Notes about some typos on: https://wiki.freebsd.org/ExternalGCC

/usr/ports/devel/ports-mgmt/pkg should be:
/usr/ports/ports-mgmt/pkg

3 examples of CROSS_TOOCLAHIN should be:
CROSS_TOOLCHAIN


Notes about the /usr/ports/base/README :

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.


=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C338B84-1179-4569-A964-CA18A22AF1D7>