Skip to content

Commit

Permalink
Do not pass -no-pie to the C compiler on musl/arm64 (#11025)
Browse files Browse the repository at this point in the history
ARM64 generates position-independent code.

Co-authored-by: omnivagant <omni+vagant@hack.org>
  • Loading branch information
kit-ty-kate and omnivagant committed Feb 18, 2022
1 parent a0ef628 commit 78539b5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ Working version

### Bug fixes:

- #11025: Do not pass -no-pie to the C compiler on musl/arm64
(omni and Kate Deplaix, review by Xavier Leroy)

OCaml 4.14.0
----------------

Expand Down
12 changes: 6 additions & 6 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1172,16 +1172,16 @@ AS_IF([test -z "$PARTIALLD"],
# Disable PIE at link time when ocamlopt does not produce position-independent
# code and the system produces PIE executables by default and demands PIC
# object files to do so.
# This issue does not affect amd64 (x86_64) and s390x (Z systems),
# since ocamlopt produces PIC object files by default.
# Currently the problem is known for Alpine Linux on platforms other
# than amd64 and s390x (issue #7562), and probably affects all Linux
# distributions that use the musl standard library and dynamic loader.
# This issue does not affect amd64 (x86_64), aarch64 (arm64)
# and s390x (Z systems), since ocamlopt produces PIC object files by default.
# Currently the problem is known for Alpine Linux on other platforms
# (issue #7562), and probably affects all Linux distributions that use
# the musl standard library and dynamic loader.
# Other systems have PIE by default but can cope with non-PIC object files,
# e.g. Ubuntu >= 17.10 for i386, which uses the glibc dynamic loader.

AS_CASE([$arch],
[amd64|s390x|none],
[amd64|aarch64|s390x|none],
# ocamlopt generates PIC code or doesn't generate code at all
[],
[AS_CASE([$host],
Expand Down

0 comments on commit 78539b5

Please sign in to comment.