cvs commit: src/share/mk bsd.lib.mk

Ruslan Ermilov ru at FreeBSD.org
Thu Sep 4 09:34:10 PDT 2003


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.
> > > > > 
> > > > I will look into what else is needed in our toolchain to get rid of these
> > > > symlinks, and get back to you, David.
> > > 
> > > 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.
> > >  
> > Sure.  The fix is to make ``cc --print-search-dirs'' output include
> > the /lib directory too.  
> 
> That is trival.
> 
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.
> 
> 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?
> 
For /lib/libfoo.so.X, create /lib/libfoo.so symlink.
For /usr/lib/libfoo.so.X, create /usr/lib/libfoo.so symlink.


Cheers,
-- 
Ruslan Ermilov		Sysadmin and DBA,
ru at sunbay.com		Sunbay Software Ltd,
ru at FreeBSD.org		FreeBSD committer
-------------- next part --------------
Index: contrib/gcc/gcc.c
===================================================================
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 = MD_STARTFILE_PREFIX;
 static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
 static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
-static const char *const standard_startfile_prefix_1 = "/lib/";
-static const char *const standard_startfile_prefix_2 = "/usr/lib/";
+static const char *const standard_startfile_prefix_1 = STANDARD_STARTFILE_PREFIX_1;
+static const char *const standard_startfile_prefix_2 = STANDARD_STARTFILE_PREFIX_2;
 
 static const char *const tooldir_base_prefix = 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);
 
+#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 */
 
-#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
===================================================================
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=		${TARGET_ARCH}-undermydesk-freebsd
 
 CFLAGS+=	-DIN_GCC -DHAVE_CONFIG_H
-CFLAGS+=	-DPREFIX=\"${TOOLS_PREFIX}/usr\"
+CFLAGS+=	-DTOOLS_PREFIX=\"${TOOLS_PREFIX}\" -DPREFIX=TOOLS_PREFIX\"/usr\"
 #CFLAGS+=	-DWANT_COMPILER_INVARIANTS
 
 # If building 64-bit longs for the i386, "_LARGE_LONG" should also be defined
Index: gnu/usr.bin/cc/cc_tools/freebsd-native.h
===================================================================
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.  */
 
-#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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20030904/61115dd9/attachment.bin


More information about the cvs-src mailing list