Commit 2f805d25 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Change link strategy: set rpath instead of linking some libs statically

Hopefully this doesn't break things for people trying non-default
toolchains, but it might.

We were previously using -static-libstdc++ to make sure that we would
find the right libstdc++.  I noticed that we weren't getting the right
version of libgcc_s (using the system one instead of the freshly-built
one), so use rpath for now.
parent 444ac6e4
...@@ -161,18 +161,8 @@ COMMON_LDFLAGS += `pkg-config tinfo && pkg-config tinfo --libs || echo ""` ...@@ -161,18 +161,8 @@ COMMON_LDFLAGS += `pkg-config tinfo && pkg-config tinfo --libs || echo ""`
# TODO should probably do the linking before MCJIT # TODO should probably do the linking before MCJIT
COMMON_LDFLAGS += -Wl,-E COMMON_LDFLAGS += -Wl,-E
# The system libstdc++ will likely be too old for Pyston, but we made a brand new one # We get multiple shared libraries (libstdc++, libgcc_s) from the gcc installation:
# as part of our GCC installation. There are a couple ways to use that one instead: COMMON_LDFLAGS += -Wl,-rpath $(GCC_DIR)/lib64
# 1) Install the built libstdc++ (~/pyston_deps/gcc-4.8.2-install/lib64/libstdc++.so.6.0.18) and update the global shared library (/usr/local/x86_64-linux-gnu/libstdc++.so.6) to point to it
# 2) Set LD_LIBRARY_PATH=~/pyston_deps/gcc-4.8.2-install/lib64
# 3) Link it in statically.
#
# For now, go with option #3 since it is the only one that requires no extra work for people who want to run Pyston.
#
# (I was surprised by this issue: the linker sees the shared library that we built
# as part of GCC and decides to dynamically link to that, even though at load time we'll
# end up linking to the system libstdc++ instead.)
COMMON_LDFLAGS += -static-libstdc++
ifneq ($(USE_DEBUG_LIBUNWIND),0) ifneq ($(USE_DEBUG_LIBUNWIND),0)
COMMON_LDFLAGS += -L$(DEPS_DIR)/libunwind-trunk-debug-install/lib COMMON_LDFLAGS += -L$(DEPS_DIR)/libunwind-trunk-debug-install/lib
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment