mirror of
https://github.com/rui314/mold.git
synced 2024-09-11 21:17:28 +03:00
[Mach-O] Add a test for mach-o stub
This commit is contained in:
parent
5dab8612c8
commit
8f10ac5047
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,5 +8,6 @@ compile_commands.json
|
||||
options.inc
|
||||
core
|
||||
ld
|
||||
ld64.mold
|
||||
gentoo
|
||||
out
|
||||
|
9
Makefile
9
Makefile
@ -75,6 +75,7 @@ all: mold mold-wrapper.so
|
||||
mold: $(OBJS) $(MIMALLOC_LIB) $(TBB_LIB)
|
||||
$(CXX) $(CPPFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
|
||||
ln -sf mold ld
|
||||
ln -sf mold ld64.mold
|
||||
|
||||
mold-wrapper.so: elf/mold-wrapper.c Makefile
|
||||
$(CC) -fPIC -shared -o $@ $< -ldl
|
||||
@ -102,13 +103,12 @@ $(TBB_LIB):
|
||||
(cd out/tbb; ln -sf *_relwithdebinfo libs)
|
||||
|
||||
test tests check: all
|
||||
$(MAKE) -C test/elf --output-sync --no-print-directory
|
||||
$(MAKE) -C test --output-sync --no-print-directory
|
||||
|
||||
install: all
|
||||
install -m 755 -d $(DEST)/bin
|
||||
install -m 755 mold $(DEST)/bin
|
||||
strip $(DEST)/bin/mold
|
||||
ln -sf mold $(DEST)/bin/ld.mold
|
||||
|
||||
install -m 755 -d $(DEST)/lib/mold
|
||||
install -m 644 mold-wrapper.so $(DEST)/lib/mold
|
||||
@ -119,12 +119,15 @@ install: all
|
||||
rm -f $(DEST)/share/man/man1/mold.1.gz
|
||||
gzip -9 $(DEST)/share/man/man1/mold.1
|
||||
|
||||
ln -sf mold $(DEST)/bin/ld.mold
|
||||
ln -sf mold $(DEST)/bin/ld64.mold
|
||||
|
||||
uninstall:
|
||||
rm -f $(DEST)/bin/mold $(DEST)/bin/ld.mold
|
||||
rm -f $(DEST)/share/man/man1/mold.1.gz
|
||||
rm -rf $(DEST)/lib/mold
|
||||
|
||||
clean:
|
||||
rm -rf *~ mold mold-wrapper.so out ld
|
||||
rm -rf *~ mold mold-wrapper.so out ld ld64.mold
|
||||
|
||||
.PHONY: all test tests check clean
|
||||
|
@ -1,8 +1,11 @@
|
||||
#include "mold.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace mold::macho {
|
||||
|
||||
int macho_main(int argc, char **argv) {
|
||||
std::cout << "mold macho stub\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
TESTS = $(wildcard *.sh)
|
||||
TESTS = $(wildcard elf/*.sh macho/*.sh)
|
||||
|
||||
test: $(TESTS)
|
||||
|
11
test/macho/basic.sh
Executable file
11
test/macho/basic.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
cd $(dirname $0)
|
||||
mold=`pwd`/../../ld64.mold
|
||||
echo -n "Testing $(basename -s .sh $0) ... "
|
||||
t=$(pwd)/../../out/test/elf/$(basename -s .sh $0)
|
||||
mkdir -p $t
|
||||
|
||||
$mold | grep -q 'mold macho stub'
|
||||
|
||||
echo OK
|
Loading…
Reference in New Issue
Block a user