Andrew G. Morgan b017fcff26 Eliminating -wrap use.
This addresses the following bug:

   https://bugzilla.kernel.org/show_bug.cgi?id=219456

insofar as it eliminates the need for -wrap=pthread_create
linkage. Mostly, code that uses -lpsx functions can simply
link with -lpsx now. However, for legacy reasons the library
still works when linked wrapped or with the new content of
the libpsx.pc file:

   -Wl,--no-as-needed -Wl,--whole-archive -lpsx -Wl,--no-whole-archive -Wl,--as-needed -lpthread

These last options are required for getting -lcap to act at a
consistent process level and not a thread level.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2024-11-09 23:19:18 -08:00

19 lines
407 B
Makefile

topdir=$(shell pwd)/../..
include ../../Make.Rules
all: threadcpp
test: all
./threadcpp
# This binary will only run from this location because we use an rpath
# to find the in-tree build of libpsx.so.
threadcpp: thread.cpp ../../libcap/libpsx.so
g++ -I../../libcap -o $@ $< -Wl,-rpath,../../libcap -lpsx -lpthread
../../libcap/libpsx.so:
$(MAKE) -C ../../libcap libpsx.so
clean:
rm -f threadcpp *~