1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/enc
Yuta Saito 50d81bfbc1 Link ext bundles with bundle loader option for newer ld64
ld64 shipped with Xcode 14 emits a warning when using `-undefined
dynamic_lookup`.

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

Actually, `-undefined dynamic_lookup` doesn't work when:

1. Link a *shared library* with the option
2. Link it with a program that uses the chained-fixup introduced from
   macOS 12 and iOS 15
because `-undefined dynamic_lookup` uses lazy-bindings and they won't be
bound while dyld fixes-up by traversing chained-fixup info.

However, we build exts as *bundles* and they are loaded only through
`dlopen`, so it's safe to use `-undefined dynamic_lookup` in theory.
So the warning produced by ld64 is false-positive, and it results
failure of option checking in configuration. Therefore, it would be an
option to ignore the warning during our configuration.

On the other hand, `-undefined dynamic_lookup` is already deprecated on
all darwin platforms except for macOS, so it's good time to get rid of
the option. ld64 also provides `-bundle_loader <executable>` option,
which allows to resolve symbols defined in the executable symtab while
linking. It behaves almost the same with `-undefined dynamic_lookup`,
but it makes the following changes:

1. Require that unresolved symbols among input objects must be defined
   in the executable.
2. Lazy symbol binding will lookup only the symtab of the bundle loader
   executable. (`-undefined dynamic_lookup` lookups all symtab as flat
   namespace)

This patch adds `-bundle_loader $(RUBY)` when non-EXTSTATIC
configuration by assuming ruby executable can be linked before building
exts.

See "New Features" subsection under "Linking" section for chained fixup
https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes
2022-08-04 16:29:22 +09:00
..
jis
trans [Feature #18249] Include ruby.h in extensions to have ABI version 2022-02-22 09:55:21 -05:00
unicode Remove Unicode 13.0.0 related files 2022-03-16 08:30:04 +09:00
ascii.c Rename ENCINDEX_ASCII to ENCINDEX_ASCII_8BIT 2022-07-19 08:48:56 +02:00
big5.c
cesu_8.c
cp949.c
depend Revert "enc/depend: fix out-of-src build with --with-static-linked-ext" (#5616) 2022-03-02 18:19:01 +09:00
ebcdic.h
emacs_mule.c
encdb.c
encinit.c.erb [Feature #18249] Include ruby.h in extensions to have ABI version 2022-02-22 09:55:21 -05:00
euc_jp.c
euc_kr.c
euc_tw.c
gb2312.c
gb18030.c
gbk.c
iso_2022_jp.h
iso_8859.h
iso_8859_1.c
iso_8859_2.c
iso_8859_3.c
iso_8859_4.c
iso_8859_5.c
iso_8859_6.c
iso_8859_7.c
iso_8859_8.c
iso_8859_9.c
iso_8859_10.c
iso_8859_11.c
iso_8859_13.c
iso_8859_14.c
iso_8859_15.c
iso_8859_16.c
koi8_r.c
koi8_u.c
make_encmake.rb
Makefile.in Link ext bundles with bundle loader option for newer ld64 2022-08-04 16:29:22 +09:00
mktable.c
shift_jis.c
shift_jis.h
unicode.c
us_ascii.c
utf_7.h
utf_8.c
utf_16_32.h
utf_16be.c
utf_16le.c
utf_32be.c
utf_32le.c
windows_31j.c
windows_1250.c
windows_1251.c
windows_1252.c
windows_1253.c
windows_1254.c
windows_1257.c
x_emoji.h