Dr. Werner Fink 2024-09-02 09:10:08 +00:00 committed by Git OBS Bridge
parent 703a98e19d
commit af415ff2f6
2 changed files with 56 additions and 68 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Sep 2 09:07:21 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- Refresh clisp.spec and make it build on s390x as well by avoiding
Position Independent Executables at compile and link time.
-------------------------------------------------------------------
Thu Aug 29 12:15:45 UTC 2024 - Dr. Werner Fink <werner@suse.de>

View File

@ -16,6 +16,7 @@
#
%bcond_with debug
%global commit f5acef38
%global vdate 20240704
@ -85,11 +86,13 @@ BuildRequires: pkgconfig(zlib)
# gcc-c++
# to BuildRequires
#
%define debug no
%define _lto_cflags %{nil}
%global ldflags %{nil}
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
%global rlver %(rpm -q --qf '%%{VERSION}' readline-devel | sed 's/\\.//g')
%define add_optflags(a:f:t:p:w:W:d:g:O:A:C:D:E:H:i:M:n:P:U:u:l:s:X:B:I:L:b:V:m:x:c:S:E:o:v:) \
%global optflags %{optflags} %{**}
%define add_ldflags(a:f:t:p:w:W:d:g:O:A:C:D:E:H:i:M:n:P:U:u:l:s:X:B:I:L:b:V:m:x:c:S:E:o:v:) \
%global ldflags %{ldflags} %{**}
Requires(pre): vim
Requires(pre): vim-data
Requires: ffcall
@ -147,8 +150,13 @@ contains two nice applications.
%patch -P 16 -p1 -b .p16
%build
%add_optflags -g3 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE
%add_optflags -Wno-unused -Wno-uninitialized -Wno-implicit-fallthrough -Wno-volatile-register-var
%add_optflags -g3 -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE
%add_optflags -fno-strict-aliasing -fPIC -pipe -Wa,--noexecstack
%add_optflags -Wno-unused -Wno-uninitialized -Wno-implicit-fallthrough -Wno-volatile-register-var -Wno-address
%add_optflags -Wno-clobbered -Wno-dangling-pointer -Wno-unused-result -Wno-missing-declarations -Wno-cast-function-type
%{expand:%%global optflags %(echo "%{optflags}"|sed -r -e s/-fstack-protector-strong// -e s/-fstack-clash-protection//)}
%{expand:%%global optflags %%optflags %(getconf LFS_CFLAGS)}
%add_ldflags -Wl,--as-needed -Wl,-z,relro -Wl,-z,noexecstack
#
# Overwrite stack size limit (hopefully a soft limit only)
#
@ -165,45 +173,47 @@ SYSTEM=${RPM_ARCH}-suse-linux
export PATH="$PATH:."
#
# Set gcc command line but do not use CFLAGS
#
if test %debug = yes ; then
CC="g++"
else
CC="gcc"
fi
%ifarch s390x
%{expand:%%global optflags %(echo "%{optflags}"|sed -r -e s/-fstack-protector-strong// -e s/-fstack-clash-protection//)}
%if %{with debug}
export CC="g++"
DEBUG=--with-debug
%add_optflags -g3 -DDEBUG_GCSAFETY
%else
DEBUG=
export CC="gcc"
%endif
%ifarch s390x ppc64 ppc64le
%{expand:%%global optflags %(echo "%{optflags}"|sed -r -e s/-fstack-protector-strong// -e s/-fstack-clash-protection//)}
%add_optflags -fno-pie -fno-PIE
%add_ldflags -no-pie
%endif
%ifarch %arm
%add_optflags -O
%endif
%ifarch aarch64
%endif
%ifarch ppc
%endif
%ifarch s390
%endif
%ifarch alpha
%endif
%ifarch %ix86
%add_optflags -ffloat-store
%endif
%ifarch x86_64 sparc sparc64 ia64 s390x ppc64 ppc64le
%add_optflags -fno-gcse
%endif
%ifarch ia64 s390x ppc64 ppc64le
%{expand:%%global optflags %(echo "%{optflags}"|sed -r -e s/-O[0-9]/-O/g)}
%endif
%ifarch sparc sparc64
%add_optflags -mcpu=v9
%endif
CC="${CC} -g %{optflags} -fno-strict-aliasing -fPIC -pipe"
case "$(uname -m)" in
i[0-9]86)
CC="${CC} -ffloat-store" ;;
arm*) CC="${CC}" ;;
aarch64)CC="${CC}" ;;
ppc) CC="${CC}" ;;
s390) CC="${CC}" ;;
x86_64) CC="${CC} -fno-gcse" ;;
sparc*) CC="${CC} -mcpu=v9 -fno-gcse" ;;
ppc64) CC="${CC} -fno-gcse -mpowerpc64" ;;
ppc64le)CC="${CC} -fno-gcse" ;;
s390x) CC="${CC} -fno-gcse" ;;
ia64) CC="${CC} -fno-gcse" ;;
axp|alpha)
CC="${CC}" ;;
esac
#
# FastCGI-devel seems a bit broken
#
CC="${CC} -I%{_includedir}/fastcgi"
%add_optflags -I%{_includedir}/fastcgi
safety='-O'
MYCFLAGS="$(getconf LFS_CFLAGS)"
if grep -q _DEFAULT_SOURCE /usr/include/features.h
then
MYCFLAGS="${MYCFLAGS} -D_GNU_SOURCE -D_DEFAULT_SOURCE"
else
MYCFLAGS="${MYCFLAGS} -D_GNU_SOURCE"
fi
# From src/makemake.in
# <cite>
# Do NOT enable -DSAFETY=3 here, because -DSAFETY=3 not only disables some
@ -214,25 +224,7 @@ port=''
%ifarch s390x
##port='--enable-portability'
%endif
case "$(uname -m)" in
i[0-9]86)
MYCFLAGS="${MYCFLAGS}" ;;
arm*) MYCFLAGS="${MYCFLAGS} ${safety}" ;;
aarch64)MYCFLAGS="${MYCFLAGS}" ;;
ppc) MYCFLAGS="${MYCFLAGS}" ;;
s390) MYCFLAGS="${MYCFLAGS}" ;;
x86_64) MYCFLAGS="${MYCFLAGS}" ;;
sparc*) MYCFLAGS="${MYCFLAGS} ${safety}" ;;
ppc64) MYCFLAGS="${MYCFLAGS} ${safety}" ;;
ppc64le)MYCFLAGS="${MYCFLAGS} ${safety}" ;;
s390x) MYCFLAGS="${MYCFLAGS} ${safety}" ;;
ia64) MYCFLAGS="${MYCFLAGS} ${safety}" ;;
axp|alpha)
MYCFLAGS="${MYCFLAGS}" ;;
esac
export CC
export MYCFLAGS
unset noexec nommap safety
export MYCFLAGS="%{optflags}"
#
# Report final architectures
@ -261,16 +253,6 @@ cat > $SCREENRC<<-EOF
silence on
utf8 on
EOF
#
# Build the current system
#
if test %debug = yes ; then
DEBUG=--with-debug
MYCFLAGS="${MYCFLAGS} -g3 -DDEBUG_GCSAFETY"
else
DEBUG=""
MYCFLAGS="${MYCFLAGS}"
fi
find -name configure | xargs -r \
sed -ri "/ac_precious_vars='build_alias\$/ {N; s/build_alias\\n//; }"
@ -317,7 +299,7 @@ tail -q -s 0.5 -f $SCREENLOG & pid=$!
--config \
CC="${CC}" \
CFLAGS="${MYCFLAGS} -Wa,--noexecstack" \
LDFLAGS="-Wl,--as-needed -Wl,-z,relro -Wl,-z,noexecstack"
LDFLAGS="%{ldflags}"
%_make -C build lispbibl.h
grep TYPECODES build/lispbibl.h || :