fix the test suite so it is even usable --- ld64-85.2.2/unit-tests/test-cases/commons-alignment/Makefile +++ ld64-85.2.2/unit-tests/test-cases/commons-alignment/Makefile @@ -29,9 +29,9 @@ all: ${CC} ${CCFLAGS} foo.s -c -o foo.o - nm -m foo.o | grep '(alignment 2^6)' | ${FAIL_IF_EMPTY} + nm -m foo.o | fgrep '(alignment 2^6)' | ${FAIL_IF_EMPTY} ${LD} foo.o -r -o foo2.o - nm -m foo2.o | grep '(alignment 2^6)' | ${PASS_IFF_STDIN} + nm -m foo2.o | fgrep '(alignment 2^6)' | ${PASS_IFF_STDIN} clean: rm -rf foo.o foo2.o --- ld64-85.2.2/unit-tests/test-cases/order_file/Makefile +++ ld64-85.2.2/unit-tests/test-cases/order_file/Makefile @@ -33,7 +33,7 @@ run: all all: - as -arch ${ARCH} -L extra.s -o extra.o + as -L extra.s -o extra.o ${CC} ${CCFLAGS} main.c extra.o -o main1 -Wl,-order_file -Wl,main1.order ${FAIL_IF_BAD_MACHO} main1 nm -n -g -j main1 | grep "_main" > main1.nm @@ -44,7 +44,7 @@ nm -n -j main2 | egrep '^_[a-z]+[0-9]$$' > main2.nm ${PASS_IFF} diff main2.nm main2.expected - ${CC} -arch ${ARCH} -c main.c -o main.o + ${CC} -c main.c -o main.o ${CC} ${CCFLAGS} main.o extra.o -o main3 -Wl,-order_file -Wl,main3.order ${FAIL_IF_BAD_MACHO} main3 nm -n -g -j main3 | grep "_main" > main3.nm --- ld64-85.2.2/unit-tests/test-cases/16-byte-alignment/Makefile +++ ld64-85.2.2/unit-tests/test-cases/16-byte-alignment/Makefile @@ -30,13 +30,13 @@ run: all all: - ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -arch ${ARCH} -c -O2 tl_test2.c -o tl_test2-${ARCH}.o + ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -c -O2 tl_test2.c -o tl_test2-${ARCH}.o # verify that the alignment is correct in the .o ObjectDump -only _ai -align -no_content tl_test2-${ARCH}.o|${FAIL_IF_ERROR} grep '\<0 mod 16\>' >/dev/null # now verify the executable - ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -arch ${ARCH} -O2 tl_test2-${ARCH}.o -o tl_test2-${ARCH} + ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -O2 tl_test2-${ARCH}.o -o tl_test2-${ARCH} ${FAIL_IF_ERROR} sh -c "nm tl_test2-${ARCH}|grep '0 D _ai\>' >/dev/null" ${PASS_IFF_GOOD_MACHO} tl_test2-${ARCH} --- ld64-85.2.2/unit-tests/test-cases/eh-strip-test/Makefile +++ ld64-85.2.2/unit-tests/test-cases/eh-strip-test/Makefile @@ -27,7 +27,7 @@ all: - ${FAIL_IF_ERROR} $(CXX) main.cxx -arch ${ARCH} -o main + ${FAIL_IF_ERROR} $(CXX) main.cxx -o main ${FAIL_IF_ERROR} nm -j main | grep '\.eh$$'| ${FAIL_IF_STDIN} ${PASS_IFF_GOOD_MACHO} main clean: --- ld64-85.2.2/unit-tests/test-cases/strip-test2/Makefile +++ ld64-85.2.2/unit-tests/test-cases/strip-test2/Makefile @@ -50,10 +50,10 @@ all: - $(CXX) main.cxx -arch ${ARCH} -o main + $(CXX) main.cxx -o main ${FAIL_IF_BAD_MACHO} main ${FAIL_IF_ERROR} nm -j main >main-no-strip.nm - $(CXX) main.cxx -arch ${ARCH} -o main + $(CXX) main.cxx -o main ${FAIL_IF_BAD_MACHO} main # Make sure there are no symbols in the stripped file that aren't --- ld64-85.2.2/unit-tests/test-cases/literals-coalesce/Makefile +++ ld64-85.2.2/unit-tests/test-cases/literals-coalesce/Makefile @@ -32,7 +32,7 @@ all: ${CC} ${ASMFLAGS} literals.s -c -o literals-${ARCH}.o - ${FAIL_IF_ERROR} ${OBJECTDUMP} literals-${ARCH}.o | grep 'name:'| uniq -c | grep -v '^ [1|2]' | ${FAIL_IF_STDIN} + ${FAIL_IF_ERROR} ${OBJECTDUMP} literals-${ARCH}.o | grep 'name:'| uniq -c | grep -v '^ *[1|2]' | ${FAIL_IF_STDIN} ${LD} -arch ${ARCH} -r literals-${ARCH}.o -o literals-r-${ARCH}.o ${FAIL_IF_ERROR} ${OBJECTDUMP} literals-r-${ARCH}.o | grep 'name:' | uniq -d | ${PASS_IFF_EMPTY} --- ld64-85.2.2/unit-tests/test-cases/stabs-coalesce/Makefile +++ ld64-85.2.2/unit-tests/test-cases/stabs-coalesce/Makefile @@ -38,7 +38,7 @@ ${FAIL_IF_BAD_MACHO} stabs-hello-${ARCH} nm -ap stabs-hello-${ARCH} | grep FUN | grep _Z3fooi | wc -l > stabs-hello-foo-count echo " 1" > one - ${PASS_IFF} diff stabs-hello-foo-count one + ${PASS_IFF} diff -w stabs-hello-foo-count one hello.o : hello.cxx ${CXX} ${CCXXFLAGS} -gstabs+ -gused hello.cxx -c -o $@