diff options
author | Nico Weber <nicolasweber@gmx.de> | 2011-01-26 21:28:52 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2011-01-26 21:28:52 +0000 |
commit | 60cd00b2cc8e912d9c2bc8d7629ba28f38030da5 (patch) | |
tree | 01f034cf64d825e8bdf9af2b6304ac4fe91dba00 | |
parent | 2c1562ebd3c20fee62b0df32589fc3d8714c94f2 (diff) | |
download | bcm5719-llvm-60cd00b2cc8e912d9c2bc8d7629ba28f38030da5.tar.gz bcm5719-llvm-60cd00b2cc8e912d9c2bc8d7629ba28f38030da5.zip |
make `make` work in examples/PrintFucntionNames on Mac. I checked that it still works on Linux.
llvm-svn: 124325
-rw-r--r-- | clang/examples/PrintFunctionNames/Makefile | 6 | ||||
-rw-r--r-- | clang/examples/PrintFunctionNames/README.txt | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/clang/examples/PrintFunctionNames/Makefile b/clang/examples/PrintFunctionNames/Makefile index 125ac4854ff..23a53054019 100644 --- a/clang/examples/PrintFunctionNames/Makefile +++ b/clang/examples/PrintFunctionNames/Makefile @@ -18,7 +18,11 @@ EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/PrintFunctionNames.exports endif endif -LINK_LIBS_IN_SHARED = 1 +LINK_LIBS_IN_SHARED = 0 SHARED_LIBRARY = 1 include $(CLANG_LEVEL)/Makefile + +ifeq ($(OS),Darwin) + LDFLAGS=-Wl,-undefined,dynamic_lookup +endif diff --git a/clang/examples/PrintFunctionNames/README.txt b/clang/examples/PrintFunctionNames/README.txt index f0f5ba6136d..4c284cd170d 100644 --- a/clang/examples/PrintFunctionNames/README.txt +++ b/clang/examples/PrintFunctionNames/README.txt @@ -1,10 +1,12 @@ This is a simple example demonstrating how to use clang's facility for providing AST consumers using a plugin. -You will probably need to build clang so that it exports all symbols (disable -TOOL_NO_EXPORT in the tools/clang Makefile). +Build the plugin by running `make` in this directory. Once the plugin is built, you can run it using: -- -$ clang -cc1 -load path/to/libPrintFunctionNames.so -plugin print-fns some-input-file.c --- +Linux: +$ clang -cc1 -load ../../Debug+Asserts/lib/libPrintFunctionNames.so -plugin print-fns some-input-file.c + +Mac: +$ clang -cc1 -load ../../Debug+Asserts/lib/libPrintFunctionNames.dylib -plugin print-fns some-input-file.c |