Skip to content

Commit

Permalink
MacOS ld warning from native compilation (bug#57849)
Browse files Browse the repository at this point in the history
* lisp/emacs-lisp/comp.el (native-comp-driver-options): Add "-Wl,-w"
on Darwin systems.
* etc/NEWS: Describe change.
  • Loading branch information
Gerd Möllmann committed Sep 19, 2022
1 parent a2f9788 commit 97b928c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions etc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ with a prefix argument or by typing 'C-u C-h C-n'.

* Changes in Specialized Modes and Packages in Emacs 28.3

** 'native-comp-driver-options' on macOS

The value of 'native-comp-driver-options' has been changed to contain
"-Wl,-w" to suppress warnings of the form

ld: warning: -undefined dynamic_lookup may not work with chained fixups

emitted during native compilation on macOS 12.6 with Xcode 14.


* New Modes and Packages in Emacs 28.3

Expand Down
5 changes: 3 additions & 2 deletions lisp/emacs-lisp/comp.el
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,15 @@ and above."
:type '(repeat string)
:version "28.1")

(defcustom native-comp-driver-options nil
(defcustom native-comp-driver-options (when (eq system-type 'darwin)
'("-Wl,-w"))
"Options passed verbatim to the native compiler's back-end driver.
Note that not all options are meaningful; typically only the options
affecting the assembler and linker are likely to be useful.
Passing these options is only available in libgccjit version 9
and above."
:type '(repeat string) ; FIXME is this right?
:type '(repeat string)
:version "28.1")

(defcustom comp-libgccjit-reproducer nil
Expand Down

1 comment on commit 97b928c

@neverpanic
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See also python/cpython#97524 (comment), which suggests this may no longer be necessary with newer Xcode. On older Xcode versions, -Wl,-no_fixup_chains should be passed instead of silencing the warning.

Please sign in to comment.