This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: make bug?
- To: Zack Weinberg <zack@rabi.phys.columbia.edu>
- Subject: Re: make bug?
- From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
- Date: 06 Jul 1998 10:28:46 +0200
- Cc: drepper@cygnus.com (Ulrich Drepper), libc-hacker@cygnus.com
- References: <199807031623.MAA12113@rabi.phys.columbia.edu>
Zack Weinberg <zack@rabi.phys.columbia.edu> writes:
|> On 03 Jul 1998 09:12:43 -0700, Ulrich Drepper wrote:
|> >Zack Weinberg <zack@rabi.phys.columbia.edu> writes:
|> >
|> >> Is anyone else seeing this? I've got only make 3.76.1 at the moment.
|> >
|> >I've done the work using make 3.75 and I've seen no such problem (and
|> >I've changed the Versions files often).
|>
|> It's a problem only on a fresh build, when there is no libc.map in the
|> build directory.
|>
|> The appended patch fixes the bug. Note that it conflicts with the
|> Makeconfig patch I posted earlier -- ignore the part of that
|> patch that modifies Makefile.
Please use this instead. The dependencies were completely wrong, and the
awk script contains a few bugs.
Andreas.
1998-07-04 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile (lib-noranlib): Don't depend on sysd-versions.
($(common-objpfx)sysd-versions): Remove rule.
* Makerules ($(common-objpfx)sysd-versions): Define here instead.
Pass name of Versions.def file to script and redirect output to
target. Include it and make all generated version maps depend on
it.
* versions.awk: Print out variable definition containing all
generated version maps. Print error messages to stderr. Remove
temp file.
--- libc-2.0.94/Makerules.~1~ Fri Jul 3 18:08:43 1998
+++ libc-2.0.94/Makerules Sat Jul 4 03:12:35 1998
@@ -276,6 +276,17 @@
no_deps=t
endif
+# Generate version maps.
+ifeq ($(versioning),yes)
+-include $(common-objpfx)sysd-versions
+$(common-objpfx)sysd-versions: $(..)Versions.def $(..)versions.awk \
+ $(wildcard $(all-subdirs:%=$(..)%/Versions)) \
+ $(wildcard $(+sysdep_dirs:%=%/Versions))
+ $(AWK) -v buildroot=$(common-objpfx) -v defsfile=$< \
+ -f $(filter-out $<,$^) > $@T
+ mv -f $@T $@
+$(all-version-maps): $(common-objpfx)sysd-versions
+endif
ifndef compile-command.S
compile-command.S = $(compile.S) $(OUTPUT_OPTION)
--- libc-2.0.94/Makefile.~1~ Fri Jul 3 18:08:42 1998
+++ libc-2.0.94/Makefile Sat Jul 4 02:17:32 1998
@@ -77,10 +77,6 @@
install-others += $(inst_includedir)/gnu/lib-names.h
endif
-ifeq ($(versioning),yes)
-lib-noranlib: $(common-objpfx)sysd-versions
-endif
-
include Makerules
ifeq ($(build-programs),yes)
@@ -315,13 +311,3 @@
.PHONY: remove-old-headers
remove-old-headers:
rm -f $(addprefix $(inst_includedir)/, $(headers2_0))
-
-# Generate version maps.
-ifeq ($(versioning),yes)
-$(common-objpfx)sysd-versions: versions.awk \
- $(wildcard $(all-subdirs:%=%/Versions)) \
- $(wildcard $(+sysdep_dirs:%=%/Versions))
- $(AWK) -v 'buildroot=$(common-objpfx)' -f $^
- rm -f $@
- echo > $@
-endif
--- libc-2.0.94/versions.awk.~1~ Fri Jul 3 18:08:45 1998
+++ libc-2.0.94/versions.awk Sat Jul 4 03:12:19 1998
@@ -6,26 +6,24 @@
# Read definitions for the versions.
BEGIN {
nlibs=0;
- while (getline < "Versions.def") {
+ while (getline < defsfile) {
if (/^[a-zA-Z_]+ {/) {
libs[$1] = 1;
curlib = $1;
- while (getline < "Versions.def" && ! /^}/) {
+ while (getline < defsfile && ! /^}/) {
+ versions[$1] = 1;
if (NF > 1) {
- versions[$1] = 1;
- derived[curlib, $1] = (" " $2);
+ derived[curlib, $1] = " " $2;
for (n = 3; n <= NF; ++n) {
- derived[curlib, $1] = sprintf("%s, %s", derived[curlib, $1], $n);
+ derived[curlib, $1] = derived[curlib, $1] ", " $n;
}
- } else {
- versions[$1] = 1;
}
}
}
}
- close("Versions.def");
+ close(defsfile);
- tmpfile = (buildroot "/Versions.tmp");
+ tmpfile = (buildroot "Versions.tmp");
sort = ("sort -n >" tmpfile);
}
@@ -37,8 +35,8 @@
# This matches the beginning of the version information for a new library.
/^[a-zA-Z_]+/ {
actlib = $1;
- if (libs[$1] != 1) {
- printf("no versions defined for %s\n", $1);
+ if (!libs[$1]) {
+ printf("no versions defined for %s\n", $1) > "/dev/stderr";
exit 1;
}
next;
@@ -47,8 +45,8 @@
# This matches the beginning of a new version for the current library.
/^ [A-Za-z_]/ {
actver = $1;
- if (versions[$1] != 1) {
- printf("version %s not defined\n", $1);
+ if (!versions[$1]) {
+ printf("version %s not defined\n", $1) > "/dev/stderr";
exit 1;
}
next;
@@ -75,6 +73,7 @@
close(sort);
oldlib="";
oldver="";
+ printf("all-version-maps =");
while(getline < tmpfile) {
if ($1 != oldlib) {
if (oldlib != "") {
@@ -85,6 +84,7 @@
oldlib = $1;
outfile = (buildroot oldlib ".map");
firstinfile = 1;
+ printf(" $(common-objpfx)%s.map", oldlib);
}
if ($2 != oldver) {
if (oldver != "") {
@@ -99,7 +99,8 @@
}
printf("\n") > outfile;
}
+ printf("\n");
closeversion(oldver);
close(outfile);
- rm tmpfile;
+ system("rm " tmpfile);
}
--
Andreas Schwab "And now for something
schwab@issan.informatik.uni-dortmund.de completely different"
schwab@gnu.org