Commits (7)
# see https://trac.sagemath.org/ticket/24575
sdh_preload_lib make libgc.so
cd src
$MAKE check
......@@ -11,13 +11,13 @@ if [ $? -ne 0 ]; then
exit 1
fi
$MAKE verbose
$MAKE verbose DLPATH_ADD=
if [ $? -ne 0 ]; then
echo >&2 "Error building arb."
exit 1
fi
$MAKE install
$MAKE install DLPATH_ADD=
if [ $? -ne 0 ]; then
echo >&2 "Error installing arb."
exit 1
......
fix compilation trouble with recent gcc versions
Sage trac ticket
https://trac.sagemath.org/ticket/24575
Upstream issue
https://github.com/jpflori/pydeformation/issues/5
---
Makefile.subdirs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.subdirs b/Makefile.subdirs
index e0b8d6a..6b17fa4 100644
--- a/Makefile.subdirs
+++ b/Makefile.subdirs
@@ -52,7 +52,7 @@ $(BUILD_DIR)/$(MOD_DIR)_%.o: %.c
$(QUIET_CC) $(CC) $(CFLAGS) $(INCS) -c $< -o $@ -MMD -MP -MF "$(BUILD_DIR)/$(MOD_DIR)_$*.d" -MT "$(BUILD_DIR)/$(MOD_DIR)_$*.d" -MT "$@"
$(MOD_LOBJ): $(LOBJS)
- $(QUIET_CC) $(CC) $(ABI_FLAG) -Wl,-r $^ -o $@ -nostdlib
+ $(QUIET_CC) $(CC) $(ABI_FLAG) -r $^ -o $@ -nostdlib
-include $(LOBJS:.lo=.d)
--
2.16.1
# see https://trac.sagemath.org/ticket/24575
sdh_preload_lib make libgc.so
cd src
$MAKE check
......@@ -8,13 +8,13 @@ if [ $? -ne 0 ]; then
exit 1
fi
$MAKE
$MAKE DLPATH_ADD=
if [ $? -ne 0 ]; then
echo >&2 "Error building deformation."
exit 1
fi
$MAKE install
$MAKE install DLPATH_ADD=
if [ $? -ne 0 ]; then
echo >&2 "Error installing deformation."
exit 1
......
......@@ -11,6 +11,10 @@ if [ "$SAGE_LOCAL" = "" ]; then
fi
cd src
# see https://trac.sagemath.org/ticket/24575
sdh_preload_lib make libgc.so
$MAKE check AT= QUIET_CC= QUIET_CXX= QUIET_AR=
if [ $? -ne 0 ]; then
......
......@@ -38,7 +38,7 @@ if [ $? -ne 0 ]; then
fi
echo "Building FLINT shared library."
$MAKE verbose
$MAKE verbose DLPATH_ADD=
if [ $? -ne 0 ]; then
echo >&2 "Error: Failed to build FLINT shared library."
exit 1
......@@ -49,7 +49,7 @@ rm -f $SAGE_LOCAL/lib/libflint*
rm -rf $SAGE_LOCAL/include/flint
echo "Installing new FLINT files."
$MAKE install
$MAKE install DLPATH_ADD=
if [ $? -ne 0 ]; then
echo >&2 "Error: Failed to install FLINT."
exit 1
......
......@@ -147,6 +147,17 @@ if [ "$UNAME" = "Darwin" ]; then
fi
fi
# Workaround for https://trac.sagemath.org/ticket/24575
# Because the build process for R (particularly for some standard packages)
# invokes the R interpreter that was just built, it results in adding
# $SAGE_LOCAL/lib to LD_LIBRARY_PATH. Normally this would not be a problem
# for anything in R, however, if *make* itself was built with libguile support
# it will load libgc (a dependency of libguile). Since LD_LIBRARY_PATH was
# modified we get the libgc from Sage, which may not be compatible with the
# one the system's libguile was built against. So we get around this by
# ensuring we pre-load the system's libgc for the remainder of the R build.
sdh_preload_lib make libgc.so
# Build R
$MAKE R
if [ $? -ne 0 ]; then
......
......@@ -10,4 +10,7 @@ cd src
export RHOMES="$SAGE_LOCAL"/lib/R
# See https://trac.sagemath.org/ticket/24575
sdh_preload_lib make libgc.so
sdh_pip_install .
......@@ -54,6 +54,13 @@
# Runs `pip install` with the given arguments, as well as additional
# default arguments used for installing packages into Sage with pip.
# Currently this is just a wrapper around the `sage-pip-install` command.
#
# - sdh_preload_lib EXECUTABLE SONAME
#
# (Linux only--no-op on other platforms.) Check shared libraries loaded by
# EXECUTABLE (may be a program or another library) for a library starting
# with SONAME, and if found appends SONAME to the LD_PRELOAD environment
# variable. See https://trac.sagemath.org/24885.
set -o allexport
......@@ -150,4 +157,26 @@ sdh_pip_install() {
}
sdh_preload_lib() {
local executable="$1"
local soname="$2"
if [ "$UNAME" != "Linux" ]; then
return 0
fi
local ldlibs="$(ldd $(which $executable))"
if [ $? -ne 0 ]; then
sdh_die "Could not get shared library dependencies for $executable"
fi
local lib=$(echo "$ldlibs" | sed -n 's/\s*'$soname'.* => \(.\+\) .*/\1/p')
if [ -n "$lib" ]; then
if [ -n "$LD_PRELOAD" ]; then
export LD_PRELOAD="$LD_PRELOAD:$lib"
else
export LD_PRELOAD="$lib"
fi
fi
}
set +o allexport