From 1171e7042fbcedb95eecda2856275fc2a119b212 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 7 Apr 2012 22:12:41 -0700 Subject: Fixes to get configure ccname=g++ working on OSX Lion. * Makefile (conftest.syms): Use -n flag in nm so that the output is not alphabetically sorted, but numerically. We need this to get the symbols ordered by increasing offset. * configure (read_syms): New function. Factors out logic used in two places for reading the output of nm. On OSX Lion, it looks like we do not get symbol sizes but offsets only, when compiling with g++. The symbols are in an S section. When compiling with gcc, we get a common C section with symbol sizes. So the hack is to use the deltas between offsets to get the sizes. The objects had to be re-ordered in decreasing rank so alignment doesn't create padding that will get counted as the size. Interleaved dummy objects of type char should also work. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 19fabd4b..f784b7e0 100644 --- a/Makefile +++ b/Makefile @@ -181,7 +181,7 @@ conftest2: conftest1.c conftest2.c $(CC) $(CFLAGS) -o $@ $^ conftest.syms: conftest.o - $(NM) -t o -P $^ > $@ + $(NM) -n -t o -P $^ > $@ .PHONY: conftest.yacc conftest.yacc: -- cgit v1.2.3