+ # build libfoo.dylib as regular dylib
+ ${CC} ${CCFLAGS} foo.c -dynamiclib -o libfoo.dylib
+ # build libtest.dylib using -mdynamic-no-pic, should fail
+ ${CC} ${CCFLAGS} test_rebase.c -c ${NO_PIC}
+ ${RELOC_FAIL} ${CC} ${CCFLAGS} test_rebase.o libfoo.dylib -dynamiclib -o libtestrebase.dylib -read_only_relocs error 2>/dev/null
+ ${CC} ${CCFLAGS} test_bind.c -c ${NO_PIC}
+ ${RELOC_FAIL} ${CC} ${CCFLAGS} test_bind.o libfoo.dylib -dynamiclib -o libtestbind.dylib -read_only_relocs error 2>/dev/null
+ # build libtest.dylib using -mdynamic-no-pic and -read_only_relocs suppress
+ ${CC} ${CCFLAGS} test_rebase.c -c ${NO_PIC}
+ ${CC} ${CCFLAGS} test_bind.c -c ${NO_PIC}
+ ${CC} ${CCFLAGS} test_rebase.o test_bind.o libfoo.dylib -dynamiclib -o libtest-no-pic.dylib -read_only_relocs suppress -Wl,-w
+ # build libtest.dylib using -static and -read_only_relocs suppress
+ ${CC} ${CCFLAGS} test_rebase.c -c ${STATIC}
+ ${CC} ${CCFLAGS} test_bind.c -c ${STATIC}
+ ${CC} ${CCFLAGS} test_rebase.o test_bind.o libfoo.dylib -dynamiclib -o libtest-static.dylib -read_only_relocs suppress -Wl,-w
+ otool -lv libtest-static.dylib | grep -A9 "sectname __text" | grep attributes | grep EXT_RELOC | ${XRELOCS_NEEDED}
+ otool -lv libtest-static.dylib | grep -A9 "sectname __text" | grep attributes | grep LOC_RELOC | ${LRELOCS_NEEDED}
+ # build main using -static and -read_only_relocs suppress
+ ${CC} ${CCFLAGS} main.c -c ${STATIC}
+ ${CC} ${CCFLAGS} main.o libfoo.dylib -o main -read_only_relocs suppress -Wl,-w
+ ${PASS_IFF_GOOD_MACHO} main