void-packages/srcpkgs/fpc/files/musl-__libc_csu.patch
Maurizio Porrato caa5ebd94d 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]
2018-01-02 14:55:35 +01:00

21 lines
840 B
Diff

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.