Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Mar 2004 09:45:22 +0200
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        current@FreeBSD.org
Subject:   Re: Upgrade broken by getopt_long_only()
Message-ID:  <20040319074522.GB18091@ip.net.ua>
In-Reply-To: <20040319034850.GA1157@xor.obsecurity.org>
References:  <20040319034850.GA1157@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--mojUlQ0s9EVzWg2t
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 18, 2004 at 07:48:50PM -0800, Kris Kennaway wrote:
> I'm attempting to update from a 5.2-CURRENT system last built on Feb
> 9, and buildworld is failing with this:
>=20
> cc -O -pipe -D_GNU_SOURCE -I. -I/usr/src/gnu/usr.bin/binutils/as/i386-fre=
ebsd -I/usr/src/gnu/usr.bin/binutils/as/i386-freebsd/../../libbfd/i386 -I/u=
sr/src/gnu/usr.bin/binutils/as/i386-freebsd/../../../../../contrib/binutils=
/include -I/usr/src/gnu/usr.bin/binutils/as/i386-freebsd/../../../../../con=
trib/binutils/gas -I/usr/src/gnu/usr.bin/binutils/as/i386-freebsd/../../../=
=2E./../contrib/binutils/gas/config -I/usr/src/gnu/usr.bin/binutils/as/i386=
-freebsd/../../../../../contrib/binutils -I/usr/src/gnu/usr.bin/binutils/as=
/i386-freebsd/.. -DVERSION=3D\""2.13.2 [FreeBSD] 2002-11-27"\" -DBFD_VERSIO=
N_STRING=3D\""2.13.2 [FreeBSD] 2002-11-27"\"  -I/usr/obj/usr/src/i386/legac=
y/usr/include  -static -L/usr/obj/usr/src/i386/legacy/usr/lib -o as app.o a=
s.o atof-generic.o atof-ieee.o bignum-copy.o cond.o dwarf2dbg.o ecoff.o exp=
r.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o =
input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o s=
b.o stabs.o subsegs.o symbols.o write.o depend.o ehopt.o obj-elf.o tc-i386.=
o ../../libbfd/libbfd.a ../../libiberty/libiberty.a ../../libopcodes/libopc=
odes.a /usr/obj/usr/src/i386/legacy/usr/lib/libegacy.a -legacy
> as.o: In function `parse_args':
> as.o(.text+0x388): undefined reference to `getopt_long_only'
> *** Error code 1
>=20
> Stop in /usr/src/gnu/usr.bin/binutils/as/i386-freebsd.
> *** Error code 1
>=20
> It looks like ache's getopt changes are causing continued problems.
>=20
tools/build/Makefile correctly bootstraps getopt_long*() functions,
and it works nicely for upgrading RELENG_4 hosts:

: # Lot of tools need <getopt.h> and getopt_long(3).
: .if !exists(/usr/include/getopt.h) || ${BOOTSTRAPPING} < 502104
: INCS+=3D          getopt.h
: .PATH: ${.CURDIR}/../../lib/libc/stdlib
: SRCS+=3D          getopt_long.c
: .endif

__FreeBSD_version is <sys/param.h> was set to 502104 in rev. 1.181:

: revision 1.181
: date: 2004/02/25 01:27:32;  author: ache;  state: Exp;  lines: +1 -1
: Bump FreeBSD_version for getopt_long_only() adding

So it looks rather like your build environment is broken.  What's the
value of __FreeBSD_version in your installed /usr/include/osreldate.h?

	cd /usr/src && make -f Makefile.inc1 -V OSRELDATE

If it doesn't correspond to your real OS version, pass the correct
value to the buildworld, like this:

	make buildworld OSRELDATE=3D`sysctl -n kern.osreldate`

Assuming the latter is correct.  If not, set it back to 502103 or,
if you are paranoid, you may even set it to 0.

P.S.  I wonder how people manage to screw up their <osreldate.h> so
often...  :-(


Cheers,
--=20
Ruslan Ermilov
FreeBSD committer
ru@FreeBSD.org

--mojUlQ0s9EVzWg2t
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAWqUSUkv4P6juNwoRAitRAJ9TV1IyHyMRmMmGwQnZ/OwDiDCNcgCdG9ZR
mg1H6TOjXkA2Y/HLEedpzHw=
=P9uC
-----END PGP SIGNATURE-----

--mojUlQ0s9EVzWg2t--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040319074522.GB18091>