Skip to content

Commit b2685ea

Browse files
committed
[docs] Document macOS as a supported host
macOS is a host for the ELF linker, not a Mach-O target. Document .dylib plugin naming and DYLD_LIBRARY_PATH search. Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
1 parent acea25c commit b2685ea

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ and is designed for easy addition of more backends.
2828

2929
## Building ELD and running tests
3030

31-
ELD supports building and running tests on Linux and Windows utilizing LLVM.
31+
ELD supports building and running tests on Linux, Windows, and macOS (Darwin)
32+
utilizing LLVM. macOS is supported as a **host** (Apple Silicon and Intel);
33+
ELD still produces ELF images and does not link Mach-O. On macOS the linker
34+
binary is built natively for the host architecture (`arm64` or `x86_64`);
35+
universal binaries are not required.
3236

3337
ELD depends on LLVM. You can build ELD either:
3438
- Integrated into an `llvm-project` build (recommended for running tests), or

docs/userguide/documentation/linker_faq.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3157,6 +3157,7 @@ Step 2
31573157
Check to see if there any system environment variables set. Important variables to note are :-
31583158
31593159
* LD_LIBRARY_PATH
3160+
* DYLD_LIBRARY_PATH (macOS)
31603161
* PATH (Windows)
31613162
31623163
Remove the values set and see if the error disappears

docs/userguide/documentation/linker_plugins/linker_plugins.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ For example::
235235
load.
236236
- Finds the library in the same search paths as if the library was passed
237237
as an input to the linker.
238-
- Uses the name of the library without the lib prefix on Linux and without
239-
the .so/.dll suffix on Linux/Windows, respectively
238+
- Uses the name of the library without the lib prefix on Linux/macOS and
239+
without the .so/.dll/.dylib suffix on Linux/Windows/macOS, respectively
240240

241241
- **PluginName**
242242

@@ -276,8 +276,8 @@ Plugin configuration file format should be as follows:::
276276
:code:`GlobalPlugins` list can specify any number of elements.
277277
:code:`Options` member is optional.
278278

279-
:code:`Library` name should be specified without the lib prefix on Linux
280-
and without the .so/.dll suffix on Linux/Windows
279+
:code:`Library` name should be specified without the lib prefix on Linux/macOS
280+
and without the .so/.dll/.dylib suffix on Linux/Windows/macOS
281281

282282
:code:`ControlMemorySizePlugin` and :code:`ControlFileSizePlugin` are output
283283
section plugins. Therefore, in the plugin configuration file, they need to be
@@ -340,6 +340,7 @@ The following steps describe how to develop a plugin:
340340
clang++ -c -I${HEXAGON_TOOLCHAIN_ROOT}/Tools/include ${SOURCE_BASENAME}.cpp -fPIC -stdlib=libc++
341341

342342
# Link the plugin library with linker wrapper library, LW.
343+
# Linux: lib${SOURCE_BASENAME}.so macOS: lib${SOURCE_BASENAME}.dylib
343344
clang++ -shared ./${SOURCE_BASENAME}.o -L${HEXAGON_TOOLCHAIN_ROOT}/Tools/lib -lLW -stdlib=libc++ -o lib${SOURCE_BASENAME}.so
344345

345346
7) Define :code:`RegisterAll` function in C linkage.
@@ -405,7 +406,9 @@ Linker performs the following operations to load, run and unload plugins.
405406

406407
2) Loads all the specified plugin libraries.
407408

408-
#. To find plugin libraries, :code:`LD_LIBRARY_PATH` environment variable is used on unix environment.
409+
#. To find plugin libraries, :code:`LD_LIBRARY_PATH` is used on Linux.
410+
On macOS, :code:`DYLD_LIBRARY_PATH` is searched first, then
411+
:code:`LD_LIBRARY_PATH`.
409412
#. Standard method for searching dynamic libraries is used in Windows.
410413

411414
3) Calls :code:`RegisterAll` function from each plugin library. This function

0 commit comments

Comments
 (0)