Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Sep 2003 19:33:58 +0300
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        "David O'Brien" <obrien@FreeBSD.org>
Cc:        Peter Wemm <peter@FreeBSD.org>
Subject:   Re: cvs commit: src/share/mk bsd.lib.mk
Message-ID:  <20030904163358.GD97732@sunbay.com>
In-Reply-To: <20030904162656.GA396@dragon.nuxi.com>
References:  <200309040429.h844TBhD058678@repoman.freebsd.org> <20030904083617.GA56261@dragon.nuxi.com> <20030904092755.GD45051@sunbay.com> <20030904140129.GA61909@dragon.nuxi.com> <20030904155659.GC97732@sunbay.com> <20030904162656.GA396@dragon.nuxi.com>

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

--Oiv9uiLrevHtW1RS
Content-Type: multipart/mixed; boundary="fXStkuK2IQBfcDe+"
Content-Disposition: inline


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

On Thu, Sep 04, 2003 at 09:26:56AM -0700, David O'Brien wrote:
> On Thu, Sep 04, 2003 at 06:56:59PM +0300, Ruslan Ermilov wrote:
> > On Thu, Sep 04, 2003 at 07:01:29AM -0700, David O'Brien wrote:
> > > On Thu, Sep 04, 2003 at 12:27:55PM +0300, Ruslan Ermilov wrote:
> > [...]
> > > > > GCC should have additional changes then.  It is going to confuse =
other
> > > > > things to have the symlink in one directory and the real libs in =
another.
> > > > >=20
> > > > I will look into what else is needed in our toolchain to get rid of=
 these
> > > > symlinks, and get back to you, David.
> > >=20
> > > Keep which ever symlinks you want /lib or /usr/lib -- but we should be
> > > totally unambigious as to which are the "real" ones, and don't install
> > > the other.  Installing two sets of symlinks isn't the way to go.
> > > =20
> > Sure.  The fix is to make ``cc --print-search-dirs'' output include
> > the /lib directory too. =20
>=20
> That is trival.
>=20
Not quite.  Just fixing STANDARD_STARTFILE_PREFIX to include
${TOOLS_PREFIX}/lib makes the output look like required, but
this does not seem to work -- linkage doesn't work.  I had
to introduce and use STANDARD_STARTFILE_PREFIX_1 and
STANDARD_STARTFILE_PREFIX_2 to make it work.  My test
buildworld just completed with this patch (and without
compatibility symlinks in /usr/lib).  But this does not
work (yet) in the CROSS_COMPILE case.  Attached is the
draft patch.

> > I'm currently testing some patches with bsd.lib.mk,v 1.152.
>=20
> We should all agree on where the symlink for things like libc.so.X live.
> I'm 99% sure Peter will argue /usr/lib, and I personally don't care -- I
> just want one of them.  Before commiting yet something else to
> bsd.lib.mk, what direction are you going in?
>=20
For /lib/libfoo.so.X, create /lib/libfoo.so symlink.
For /usr/lib/libfoo.so.X, create /usr/lib/libfoo.so symlink.


Cheers,
--=20
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software Ltd,
ru@FreeBSD.org		FreeBSD committer

--fXStkuK2IQBfcDe+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=p
Content-Transfer-Encoding: quoted-printable

Index: contrib/gcc/gcc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/contrib/gcc/gcc.c,v
retrieving revision 1.36
diff -u -r1.36 gcc.c
--- contrib/gcc/gcc.c	11 Jul 2003 04:45:39 -0000	1.36
+++ contrib/gcc/gcc.c	4 Sep 2003 16:02:07 -0000
@@ -1319,6 +1319,12 @@
 #ifndef STANDARD_STARTFILE_PREFIX
 #define STANDARD_STARTFILE_PREFIX "/usr/local/lib/"
 #endif
+#ifndef STANDARD_STARTFILE_PREFIX_1
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#endif
+#ifndef STANDARD_STARTFILE_PREFIX_2
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+#endif
 #ifndef TOOLDIR_BASE_PREFIX
 #define TOOLDIR_BASE_PREFIX "/usr/local/"
 #endif
@@ -1335,8 +1341,8 @@
 static const char *md_startfile_prefix =3D MD_STARTFILE_PREFIX;
 static const char *md_startfile_prefix_1 =3D MD_STARTFILE_PREFIX_1;
 static const char *const standard_startfile_prefix =3D STANDARD_STARTFILE_=
PREFIX;
-static const char *const standard_startfile_prefix_1 =3D "/lib/";
-static const char *const standard_startfile_prefix_2 =3D "/usr/lib/";
+static const char *const standard_startfile_prefix_1 =3D STANDARD_STARTFIL=
E_PREFIX_1;
+static const char *const standard_startfile_prefix_2 =3D STANDARD_STARTFIL=
E_PREFIX_2;
=20
 static const char *const tooldir_base_prefix =3D TOOLDIR_BASE_PREFIX;
 static const char *tooldir_prefix;
@@ -6060,6 +6066,7 @@
 	add_prefix (&startfile_prefixes, md_startfile_prefix_1, "GCC",
 		    PREFIX_PRIORITY_LAST, 0, NULL, 1);
=20
+#ifndef FREEBSD_NATIVE
       /* If standard_startfile_prefix is relative, base it on
 	 standard_exec_prefix.  This lets us move the installed tree
 	 as a unit.  If GCC_EXEC_PREFIX is defined, base
@@ -6080,13 +6087,12 @@
 			      standard_startfile_prefix, NULL),
 		      NULL, PREFIX_PRIORITY_LAST, 0, NULL, 1);
 	}
+#endif	/* not FREEBSD_NATIVE */
=20
-#ifndef FREEBSD_NATIVE
       add_prefix (&startfile_prefixes, standard_startfile_prefix_1,
 		  "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
       add_prefix (&startfile_prefixes, standard_startfile_prefix_2,
 		  "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
-#endif	/* not FREEBSD_NATIVE */
 #if 0 /* Can cause surprises, and one can use -B./ instead.  */
       add_prefix (&startfile_prefixes, "./", NULL,
 		  PREFIX_PRIORITY_LAST, 1, NULL, 0);
Index: gnu/usr.bin/cc/Makefile.inc
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/gnu/usr.bin/cc/Makefile.inc,v
retrieving revision 1.63
diff -u -r1.63 Makefile.inc
--- gnu/usr.bin/cc/Makefile.inc	4 Jun 2002 19:45:08 -0000	1.63
+++ gnu/usr.bin/cc/Makefile.inc	4 Sep 2003 16:04:37 -0000
@@ -15,7 +15,7 @@
 target=3D		${TARGET_ARCH}-undermydesk-freebsd
=20
 CFLAGS+=3D	-DIN_GCC -DHAVE_CONFIG_H
-CFLAGS+=3D	-DPREFIX=3D\"${TOOLS_PREFIX}/usr\"
+CFLAGS+=3D	-DTOOLS_PREFIX=3D\"${TOOLS_PREFIX}\" -DPREFIX=3DTOOLS_PREFIX\"/=
usr\"
 #CFLAGS+=3D	-DWANT_COMPILER_INVARIANTS
=20
 # If building 64-bit longs for the i386, "_LARGE_LONG" should also be defi=
ned
Index: gnu/usr.bin/cc/cc_tools/freebsd-native.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/gnu/usr.bin/cc/cc_tools/freebsd-native.h,v
retrieving revision 1.23
diff -u -r1.23 freebsd-native.h
--- gnu/usr.bin/cc/cc_tools/freebsd-native.h	11 Jul 2003 05:33:24 -0000	1.23
+++ gnu/usr.bin/cc/cc_tools/freebsd-native.h	4 Sep 2003 16:03:53 -0000
@@ -40,7 +40,8 @@
 /* Under FreeBSD, the normal location of the various *crt*.o files is the
    /usr/lib directory.  */
=20
-#define STANDARD_STARTFILE_PREFIX	PREFIX"/lib/"
+#define STANDARD_STARTFILE_PREFIX_1	TOOLS_PREFIX"/lib/"
+#define STANDARD_STARTFILE_PREFIX_2	TOOLS_PREFIX"/usr/lib/"
 #ifdef CROSS_COMPILE
 #define CROSS_STARTFILE_PREFIX		PREFIX"/lib/"
 #endif

--fXStkuK2IQBfcDe+--

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

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

iD8DBQE/V2l2Ukv4P6juNwoRAoO7AJ9I3Lx2FJh5HPvAEXAxZpkmOpZtEQCcDEIj
4jYABYmIhnfPKEiCWe7k+0I=
=S5B7
-----END PGP SIGNATURE-----

--Oiv9uiLrevHtW1RS--



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