NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PR/59064 CVS commit: src



The following reply was made to PR port-mips/59064; it has been noted by GNATS.

From: "Taylor R Campbell" <riastradh%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/59064 CVS commit: src
Date: Sun, 13 Apr 2025 17:23:06 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sun Apr 13 17:23:06 UTC 2025
 
 Modified Files:
 	src: UPDATING
 	src/share/mk: bsd.lib.mk
 
 Log Message:
 bsd.lib.mk: Redo rev. 1.418 more selectively.
 
 Previously, in rev. 1.418, I had changed:
 
  .if ${LIBISPRIVATE} != "no"
 ...
  . if defined(NOSTATICLIB) && ${MKPICLIB} != "no"
  MAKESTATICLIB?=	no
  . elif ${LIBISPRIVATE} != "pic"
  MKPIC:=		no
  . endif
 ...
  .endif
 ...
 -.if ${LIBISPRIVATE} == "pic"
 +.if ${MKPIC} != "no"
  CFLAGS+=        -fPIC
  AFLAGS+=        -fPIC
  .endif
 
 This was an attempt to obviate the need for grody conditionals in
 private shared libraries like libuv:
 
 .if ${MACHINE} == "sun2"
 LIBISPRIVATE=yes
 .else
 LIBISPRIVATE=pic
 .endif
 
 This is wrong, after all, because you can also do MKPIC=no on
 non-sun2 platforms if you really want a static build, and it's a mess
 to have to write it out in every case.
 
 My theory in making that change was that:
 
 (a) on MKPIC=yes platforms in makefiles without LIBISPRIVATE=yes,
     we're building with -fPIC anyway, so ${MKPIC} != no is right;
 
 (b) on MKPIC=yes platforms in makefiles with LIBISPRIVATE=yes, we
     shouldn't build with -fPIC and the conditional above sets
     MKPIC=no in that case, so ${MKPIC} != no is right;
 
 (c) on MKPIC=no platforms (mainly sun2), no matter what LIBISPRIVATE
     is set to, we shouldn't build with -fPIC, so ${MKPIC} != no is
     right.
 
 But (a) is wrong, because we use the same makefile to build .pico and
 .o objects from which we link (PIC) .so and (non-PIC) .a libraries,
 and the distinction is made not in CFLAGS/AFLAGS but in PICFLAGS and
 CSHLIBFLAGS.
 
 So, to obviate the need for the .if sun2 conditionals around
 LIBISPRIVATE=pic, but avoid breaking everything _other_ than
 LIBISPRIVATE=pic, let's make the addition of -fPIC to CFLAGS/AFLAGS
 conditional on _both_ LIBISPRIVATE=pic _and_ MKPIC=yes.
 
 PR port-mips/59064: jemalloc switch to 5.3 broke userland
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.376 -r1.377 src/UPDATING
 cvs rdiff -u -r1.418 -r1.419 src/share/mk/bsd.lib.mk
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index