From 5cbd73b809f24c435cc4b4523e8add1fda3acfb5 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 22 Feb 2012 17:09:31 -0500 Subject: [PATCH] Revert "Detect and document dependency on -ldl on Linux, -lc on BSD for dlopen" This reverts commit 90cefaa31af0a85593a155fba8570e04c653225a. Signed-off-by: Mathieu Desnoyers --- README | 6 +++--- configure.ac | 20 ++----------------- doc/examples/easy-ust/Makefile | 3 +-- doc/examples/gen-tp/Makefile | 4 +--- liblttng-ust-fork/Makefile.am | 9 +-------- liblttng-ust-libc-wrapper/Makefile.am | 9 +-------- tests/demo/Makefile.am | 10 ++-------- tests/demo/README | 3 +-- tests/dlopen/Makefile.am | 9 +-------- tests/hello-static-lib/Makefile.am | 9 +-------- tests/hello.cxx/Makefile.am | 7 ------- tests/hello/Makefile.am | 7 ------- ...akefile.example.linux => Makefile.example} | 0 tests/hello/Makefile.example.bsd | 8 -------- 14 files changed, 14 insertions(+), 90 deletions(-) rename tests/hello/{Makefile.example.linux => Makefile.example} (100%) delete mode 100644 tests/hello/Makefile.example.bsd diff --git a/README b/README index 78ed56f6..e2b52aa0 100644 --- a/README +++ b/README @@ -67,7 +67,7 @@ USAGE: "TRACEPOINT_DEFINE" and include the tracepoint provider. - Use "-I." for the compilation unit containing the tracepoint provider include (e.g. tp.c). - - Link application with "-ldl" on Linux, with "-lc" on BSD. + - Link application with "-ldl". - If building the provider directly into the application, link the application with "-llttng-ust". - If building a static library for the provider, link the static @@ -75,7 +75,7 @@ USAGE: - Include the tracepoint provider header into all C files using the provider. - Example: - tests/hello/ hello.c tp.c ust_tests_hello.h Makefile.example.* + tests/hello/ hello.c tp.c ust_tests_hello.h Makefile.example 2) Compile the Tracepoint Provider separately from the application, using dynamic linking: @@ -87,7 +87,7 @@ USAGE: files that use the provider. - Compile the tracepoint provider with "-I.". - Link the tracepoint provider with "-llttng-ust". - - Link application with "-ldl" on Linux, "-lc" on BSD. + - Link application with "-ldl". - Set a LD_PRELOAD environment to preload the tracepoint provider shared object before starting the application when tracing is needed. diff --git a/configure.ac b/configure.ac index 167cd880..aa0fac34 100644 --- a/configure.ac +++ b/configure.ac @@ -42,23 +42,7 @@ AC_PROG_MAKE_SET LT_INIT ## Checks for libraries. -AC_CHECK_LIB([dl], [dlopen], -[ - have_libdl=yes -], -[ - #libdl not found, check for dlopen in libc. - AC_CHECK_LIB([c], [dlopen], - [ - have_libc_dl=yes - ], - [ - AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.]) - ]) -]) -AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"]) -AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"]) - +AC_CHECK_LIB([dl], [dlopen]) AC_CHECK_LIB([pthread], [pthread_create]) # Check for libuuid @@ -75,7 +59,7 @@ AC_CHECK_LIB([uuid], [uuid_generate], have_libc_uuid=yes ], [ - AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) + AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify its location.]) ]) ] ) diff --git a/doc/examples/easy-ust/Makefile b/doc/examples/easy-ust/Makefile index 3d043df4..597071b5 100644 --- a/doc/examples/easy-ust/Makefile +++ b/doc/examples/easy-ust/Makefile @@ -16,8 +16,7 @@ # the "html" target helps for documentation (req. code2html) CC = gcc -LIBS = -ldl -llttng-ust # On Linux -#LIBS = -lc -llttng-ust # On BSD +LIBS = -ldl -llttng-ust CFLAGS = -I. all: sample diff --git a/doc/examples/gen-tp/Makefile b/doc/examples/gen-tp/Makefile index 518f0174..b29eed4c 100644 --- a/doc/examples/gen-tp/Makefile +++ b/doc/examples/gen-tp/Makefile @@ -16,9 +16,7 @@ # provider probe. CC = gcc - -LIBS = -ldl -llttng-ust #On Linux -#LIBS = -lc -llttng-ust #On BSD +LIBS = -ldl -llttng-ust all: sample diff --git a/liblttng-ust-fork/Makefile.am b/liblttng-ust-fork/Makefile.am index 49466f64..e0e42a3f 100644 --- a/liblttng-ust-fork/Makefile.am +++ b/liblttng-ust-fork/Makefile.am @@ -4,13 +4,6 @@ AM_CFLAGS = -fno-strict-aliasing lib_LTLIBRARIES = liblttng-ust-fork.la liblttng_ust_fork_la_SOURCES = ustfork.c liblttng_ust_fork_la_LIBADD = \ + -ldl \ $(top_builddir)/liblttng-ust/liblttng-ust.la - -if LTTNG_UST_BUILD_WITH_LIBDL -liblttng_ust_fork_la_LIBADD += -ldl -endif -if LTTNG_UST_BUILD_WITH_LIBC_DL -liblttng_ust_fork_la_LIBADD += -lc -endif - libustfork_CFLAGS = -DUST_COMPONENT=liblttng-ust-fork -fno-strict-aliasing diff --git a/liblttng-ust-libc-wrapper/Makefile.am b/liblttng-ust-libc-wrapper/Makefile.am index 5b3f7f0d..6220f76c 100644 --- a/liblttng-ust-libc-wrapper/Makefile.am +++ b/liblttng-ust-libc-wrapper/Makefile.am @@ -5,16 +5,9 @@ lib_LTLIBRARIES = liblttng-ust-libc-wrapper.la liblttng_ust_libc_wrapper_la_SOURCES = \ lttng-ust-malloc.c \ ust_libc.h -liblttng_ust_libc_wrapper_la_LIBADD = \ +liblttng_ust_libc_wrapper_la_LIBADD = -ldl \ -L$(top_builddir)/liblttng-ust/.libs \ -llttng-ust -if LTTNG_UST_BUILD_WITH_LIBDL -liblttng_ust_libc_wrapper_la_LIBADD += -ldl -endif -if LTTNG_UST_BUILD_WITH_LIBC_DL -liblttng_ust_libc_wrapper_la_LIBADD += -lc -endif - noinst_SCRIPTS = run EXTRA_DIST = run diff --git a/tests/demo/Makefile.am b/tests/demo/Makefile.am index e4570ff0..f96980ed 100644 --- a/tests/demo/Makefile.am +++ b/tests/demo/Makefile.am @@ -33,11 +33,5 @@ liblttng_ust_provider_ust_tests_demo3_la_LDFLAGS = \ noinst_PROGRAMS = demo demo_SOURCES = demo.c ust_tests_demo.h -# The demo program only depends on libdl/libc for dlopen(). -if LTTNG_UST_BUILD_WITH_LIBDL -demo_LDADD = -ldl -endif -if LTTNG_UST_BUILD_WITH_LIBC_DL -demo_LDADD = -lc -endif - +# The demo program only depends on libdl. +demo_LDFLAGS = -ldl diff --git a/tests/demo/README b/tests/demo/README index 03ee4ee1..cc51b67c 100644 --- a/tests/demo/README +++ b/tests/demo/README @@ -4,8 +4,7 @@ demo-trace shell script preloads the provider shared objects before executing the demo. Executing "demo" without the shell wrapper will not provide any tracing support. This ensures the demo binary can be distributed on distros without depending on having liblttng-ust.so in -place. Note: the "demo" program must be compiled with "-ldl" on Linux, -with "-lc" on BSD. +place. Note: the "demo" program must be compiled with "-ldl". The simplest command to trace the demo program are: lttng create diff --git a/tests/dlopen/Makefile.am b/tests/dlopen/Makefile.am index de05346c..89fd9dbf 100644 --- a/tests/dlopen/Makefile.am +++ b/tests/dlopen/Makefile.am @@ -6,14 +6,7 @@ libdummy_la_SOURCES = libdummy.c libdummy_la_LIBADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o libdummy_la_LDFLAGS = -rpath /nowhere dlopen_SOURCES = dlopen.c -dlopen_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o - -if LTTNG_UST_BUILD_WITH_LIBDL -dlopen_LDADD += -ldl -endif -if LTTNG_UST_BUILD_WITH_LIBC_DL -dlopen_LDADD += -lc -endif +dlopen_LDADD = -ldl $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o noinst_SCRIPTS = run EXTRA_DIST = run diff --git a/tests/hello-static-lib/Makefile.am b/tests/hello-static-lib/Makefile.am index 66334894..0eff080c 100644 --- a/tests/hello-static-lib/Makefile.am +++ b/tests/hello-static-lib/Makefile.am @@ -8,14 +8,7 @@ liblttng_ust_provider_ust_test_hello_la_LIBADD = \ noinst_PROGRAMS = hello hello_SOURCES = hello.c -hello_LDADD = liblttng-ust-provider-ust-test-hello.la - -if LTTNG_UST_BUILD_WITH_LIBDL -hello_LDADD += -ldl -endif -if LTTNG_UST_BUILD_WITH_LIBC_DL -hello_LDADD += -lc -endif +hello_LDADD = -ldl liblttng-ust-provider-ust-test-hello.la noinst_SCRIPTS = run EXTRA_DIST = run diff --git a/tests/hello.cxx/Makefile.am b/tests/hello.cxx/Makefile.am index f56f431c..3e84796a 100644 --- a/tests/hello.cxx/Makefile.am +++ b/tests/hello.cxx/Makefile.am @@ -4,12 +4,5 @@ noinst_PROGRAMS = hello hello_SOURCES = hello.cpp tp.c ust_tests_hello.h hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la -if LTTNG_UST_BUILD_WITH_LIBDL -hello_LDADD += -ldl -endif -if LTTNG_UST_BUILD_WITH_LIBC_DL -hello_LDADD += -lc -endif - noinst_SCRIPTS = run EXTRA_DIST = run diff --git a/tests/hello/Makefile.am b/tests/hello/Makefile.am index 847e64d9..d866b6da 100644 --- a/tests/hello/Makefile.am +++ b/tests/hello/Makefile.am @@ -4,12 +4,5 @@ noinst_PROGRAMS = hello hello_SOURCES = hello.c tp.c ust_tests_hello.h hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la -if LTTNG_UST_BUILD_WITH_LIBDL -hello_LDADD += -ldl -endif -if LTTNG_UST_BUILD_WITH_LIBC_DL -hello_LDADD += -lc -endif - noinst_SCRIPTS = run EXTRA_DIST = run diff --git a/tests/hello/Makefile.example.linux b/tests/hello/Makefile.example similarity index 100% rename from tests/hello/Makefile.example.linux rename to tests/hello/Makefile.example diff --git a/tests/hello/Makefile.example.bsd b/tests/hello/Makefile.example.bsd deleted file mode 100644 index 607171c2..00000000 --- a/tests/hello/Makefile.example.bsd +++ /dev/null @@ -1,8 +0,0 @@ -# Example makefile for build outside of the LTTng-UST tree. - -hello: - ${CC} -O2 -I. -o hello -lc -llttng-ust hello.c tp.c - -.PHONY: clean -clean: - rm -f hello -- 2.34.1