Commit Graph

10 Commits

Author SHA1 Message Date
Jonas Hahnfeld
76e87e6686 Remove REQUIRES: not_system-windows
Replace it by the standard UNSUPPORTED: system-windows.
2023-08-14 18:44:02 +02:00
Jonas Hahnfeld
bb45512ff6 Stop using triple substrings in UNSUPPORTED
With LLVM 16 and https://reviews.llvm.org/D141007, this will not be
supported anymore. As a replacement, use system-{darwin,linux,windows}.
2023-08-14 18:44:02 +02:00
Javier Lopez-Gomez
5ca904dabd Fix DynamicLibraryManager/cached_realpath.C test
Fetching the value of `errno` only makes sense after a failed call to
`realpath()`, i.e. if the return value of the function is NULL.
2023-05-19 23:29:06 +02:00
Javier Lopez-Gomez
4d49306895 Fix DynamicLibraryManager/callable_lib_L_AB_order1.C test
`--enable-new-dtags` is needed in some toolchains to emit the new ELF dynamic
tags, i.e. RUNPATH.
Per ld(1) manual page: `By default, the new dynamic tags are not created.`
2023-05-19 23:29:06 +02:00
Axel Naumann
cf44b102bf Fix cached_realpath.C test by removing stale test dir. 2022-05-31 15:44:05 +02:00
Jonas Hahnfeld
35b71f2d93 Fix test/DynamicLibraryManager/callable_lib_L_AB_abs.C (#10542)
Just pass the absolute path, do not prefix with -l which confuses ld.
2022-05-11 09:44:06 +02:00
Vassil Vassilev
884df027c3 Fix bugs in cling's tests.
Patch by Alexander Penev (@alexander-penev).
2022-01-07 16:29:03 +01:00
Vassil Vassilev
4fa39ba82f Do not resolve symbols from executables compiled with -fPIE.
Executables that are compiled with fPIE means they are compiled in a position
independent manner and are almost indistinguishable from the shared objects. A
reasonably reliable way to find if this was a `pie executable` is to check the
`DF_1_PIE` in the dynamic section of ELF.

The pseudo-code is:
```
if DT_FLAGS_1 dynamic section entry is present
  if DF_1_PIE is set in DT_FLAGS_1:
    print pie executable
  else
    print shared object
```

See https://stackoverflow.com/questions/34519521/why-does-gcc-create-a-shared-object-instead-of-an-executable-binary-according-to/34522357#34522357

Fixes root-project/root#7366

Patch by Alexander Penev (@alexander-penev)
2022-01-07 16:29:03 +01:00
Vassil Vassilev
d36bfe15e4 Ask for the real path in any case. 2021-08-07 09:29:07 +02:00
Vassil Vassilev
55a4e89b3b Fix ROOT-10484 by implementing dyld support for RPATH.
Some libraries are layered can depend on other libraries on a private paths.
That is, libA can depend on libB which is neither on the LD_LIBRARY_PATH nor
on a known system path. The posix linker injects "variables" such as @rpath
which is expanded at link time to resolve the libraries on a relative path.

Prior to this patch, cling's Dyld-based symbol resolution could not trace down
such cases causing failures in symbol resolution when a symbol is only defined
in libB (a private library).

This patch implements the basic posix linker substitutions allowing cling's
Dyld-based symbol resolution implementation to follow more closely the linker
rules.

Kudos Alexander Penev (@alexander-penev).
2021-08-07 09:29:07 +02:00