fpc: update to 3.0.4

@pullmoll enabled x86_64-musl with a hack. Needs testing.
Building for i686-musl currently segfaults for unknown reasons.

Closes: #10350 [via git-merge-pr]
This commit is contained in:
Maurizio Porrato 2018-01-02 13:34:50 +01:00 committed by Jürgen Buchmüller
parent 1ee4879524
commit caa5ebd94d
2 changed files with 30 additions and 11 deletions

View File

@ -0,0 +1,21 @@
Hack to remove reference to the (glibc only) symbols __libc_csu_init
and __libc_csu_fini. They are the libc initialize and finish function
pointers. Not sure if this actually works, or if calling the pointers
to be stored there before/after the call to PASCALMAIN is required.
--- fpcsrc/rtl/linux/x86_64/cprt0.as 2015-12-16 16:28:03.000000000 +0100
+++ fpcsrc/rtl/linux/x86_64/cprt0.as 2018-01-02 14:41:08.598952141 +0100
@@ -63,9 +63,10 @@
pushq %rsp
/* Pass address of our own entry points to .fini and .init. */
- movq __libc_csu_init@GOTPCREL(%rip), %rcx
- movq __libc_csu_fini@GOTPCREL(%rip), %r8
-
+/* not availble in musl libc
+ * movq __libc_csu_init@GOTPCREL(%rip), %rcx
+ * movq __libc_csu_fini@GOTPCREL(%rip), %r8
+ */
movq main_stub@GOTPCREL(%rip), %rdi
/* Call the user's main function, and exit with its value.

View File

@ -1,6 +1,6 @@
# Template file for 'fpc'
pkgname=fpc
version=3.0.2
version=3.0.4
revision=1
create_wrksrc=yes
build_wrksrc="${pkgname}build-${version}"
@ -11,19 +11,16 @@ short_desc="Free Pascal Compiler"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2, LGPL-2.1, FPC-FPR"
homepage="http://freepascal.org/"
distfiles="http://gd.tuwien.ac.at/languages/pascal/${pkgname}/dist/${version}/source/${pkgname}build-${version}.tar.gz"
checksum=f261ed0a361f190169fff428d65b707df1507df317fc0ed101b0e63596541b75
distfiles="${SOURCEFORGE_SITE}/freepascal/Source/${version}/${pkgname}build-${version}.tar.gz"
checksum=f66514e6f2c2e4e1bccccb4d554c24b77682ed61c87811ae5dd210f421855e76
case "$XBPS_TARGET_MACHINE" in
*-musl*)
broken="https://build.voidlinux.eu/builders/x86_64-musl_builder/builds/1375/steps/shell_3/logs/stdio"
;;
x86_64*)
distfiles+=" http://gd.tuwien.ac.at/languages/pascal/${pkgname}/dist/${version}/x86_64-linux/${pkgname}-${version}-1.x86_64.rpm"
checksum+=" 85ad192927b2129022c27afbd6a6fc657a569ccfb43120e4868fea7812c10c52"
distfiles+=" ${SOURCEFORGE_SITE}/freepascal/Linux/${version}/${pkgname}-${version}-1.x86_64.rpm"
checksum+=" c7b75f09174a502d8dd776fbfabcad3e4360494fd635445185159b21001d65f1"
;;
i686)
distfiles+=" http://gd.tuwien.ac.at/languages/pascal/${pkgname}/dist/${version}/i386-linux/${pkgname}-${version}-1.i686.rpm"
checksum+=" 0f049ff901305c315f90ec4c80fd3b054b97b1d8fca1552bcb036299aa64338f"
i686*)
distfiles+=" ${SOURCEFORGE_SITE}/freepascal/Linux/${version}/${pkgname}-${version}-1.i686.rpm"
checksum+=" a8f1ea31c63e8cd96dbdecf02af97311f14629babe58b4bd18ecfa094a13ad45"
;;
esac
# TODO: figure out cross-build and how to unwrap the ARM .tar.
@ -40,6 +37,7 @@ post_extract() {
case "$XBPS_TARGET_MACHINE" in
x86_64-musl)
sed -i s,/lib64/ld-linux-x86-64.so.2,/lib/ld-musl-x86_64.so.1, $build_wrksrc/fpcsrc/compiler/systems/t_linux.pas
cd $build_wrksrc && patch -p0 < ${FILESDIR}/musl-__libc_csu.patch
;;
i686-musl)
sed -i s,/lib/ld-linux.so.2,/lib/ld-musl-i386.so.1, $build_wrksrc/fpcsrc/compiler/systems/t_linux.pas