Skip to content

Conversation

@ibc
Copy link
Member

@ibc ibc commented Jan 3, 2024

More details

In https://mesonbuild.com/Builtin-options.html#base-options:

The following options are available. Note that they may not be available on all platforms or with all compilers:
[...]

  • b_staticpic: Build static libraries as position independent
  • b_pie: Build position-independent executables (since 0.49.0)

Somewhere else:

Position-independent code is not tied to a specific address. This independence allows the code to execute efficiently at a different address in each process that uses the code. Position-independent code is recommended for the creation of shared objects.

On some architectures, including x86, -fPIC generates much worse code (i.e. a function call) for loads/stores of data. While this is tolerable for libraries, it is undesirable for executables.

If the object is to be linked as a shared library, or a static library that will in turn be linked in a shared library, use -fPIC. If the object is to be linked as a position indenpendent executable, or astatic library that will in turn be linked in position independent executable, use -fPIE.

blablabla

- May fix #1292
- `PIC` flag was introduced in previous mediasoup gyp build system: bbc3514, it was needed for mediasoup to build on Ubuntu 18.04: #315.
@ibc ibc requested review from jmillan and nazar-pc January 3, 2024 11:19
@ibc ibc merged commit ddcd72f into v3 Jan 3, 2024
@ibc ibc deleted the meson-remove-pie-and-staticpic-options branch January 3, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Windows CI jobs failing due to meson

3 participants