sbcl rebuild
[arch-packages.git] / libtool / trunk / disable-lto-link-order2.patch
blob7287cefe5c3de0d2ab2255dc567bf9bc2f3ddaeb
1 This patch is derived from
2 https://src.fedoraproject.org/rpms/libtool/blob/rawhide/f/libtool-2.4.6-disable-lto-link-order2.patch
4 Enabling lto will result in failure during test phase, to be precise test 67 will cause it.
5 Compiler flags for this test (and most likely for rest of them) are inherited from actual build phase.
6 I'm not sure if this is expected.
8 Most distribution disables this test. We try to keep it by stripping lto flags for it.
10 Origin for this tests: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=391427
12 --- a/tests/link-order2.at 2015-01-16 19:52:04.000000000 +0100
13 +++ b/tests/link-order2.at 2021-11-30 02:01:09.574451906 +0100
14 @@ -47,6 +47,8 @@
15 AT_KEYWORDS([libtool])
16 AT_KEYWORDS([interactive])dnl running 'wrong' may cause a popup window.
18 +NO_LTO_CFLAGS=${CFLAGS/ -flto}
20 eval `$LIBTOOL --config | $EGREP '^(shlibpath_var|allow_undefined_flag)='`
22 undefined_setting=-no-undefined
23 @@ -89,12 +91,12 @@
24 EOF
26 for file in a0 a1 b; do
27 - $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c $file.c
28 + $LIBTOOL --mode=compile $CC $CPPFLAGS $NO_LTO_CFLAGS -c $file.c
29 done
30 -$CC $CPPFLAGS $CFLAGS -c main.c
31 +$CC $CPPFLAGS $NO_LTO_CFLAGS -c main.c
33 # Build an old, installed library.
34 -$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $static -o liba0.la a0.lo -rpath $deflibdir
35 +$LIBTOOL --mode=link $CC $NO_LTO_CFLAGS $LDFLAGS $static -o liba0.la a0.lo -rpath $deflibdir
36 $LIBTOOL --mode=install cp liba0.la $deflibdir/liba0.la
37 $LIBTOOL --mode=clean rm -f liba0.la
39 @@ -118,13 +120,13 @@
40 esac
41 test non-libtool,-static-libtool-libs = "$type_of_depdepl,$static" &&
42 static=-all-static
43 - $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $static -o liba1.la a1.lo -rpath $libdir
44 - $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $static -o libb.la b.lo liba1.la -rpath $libdir
45 - AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $static -o main$EXEEXT main.$OBJEXT libb.la -la0],
46 + $LIBTOOL --mode=link $CC $NO_LTO_CFLAGS $LDFLAGS $static -o liba1.la a1.lo -rpath $libdir
47 + $LIBTOOL --mode=link $CC $NO_LTO_CFLAGS $LDFLAGS $static -o libb.la b.lo liba1.la -rpath $libdir
48 + AT_CHECK([$LIBTOOL --mode=link $CC $NO_LTO_CFLAGS $LDFLAGS $static -o main$EXEEXT main.$OBJEXT libb.la -la0],
49 [], [ignore], [ignore])
50 LT_AT_EXEC_CHECK([./main])
51 # Now test that if we reverse the link order, the program fails.
52 - AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $static -o wrong$EXEEXT main.$OBJEXT -la0 libb.la],
53 + AT_CHECK([$LIBTOOL --mode=link $CC $NO_LTO_CFLAGS $LDFLAGS $static -o wrong$EXEEXT main.$OBJEXT -la0 libb.la],
54 [], [ignore], [ignore])
55 if test yes, != "$shared_fails,$static"; then
56 LT_AT_EXEC_CHECK([./wrong], [1], [], [ignore], [|| (exit 1)])