Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return -DPIC with pkg-config --cflags alsa when appropriate #289

Open
afq984 opened this issue Dec 31, 2022 · 2 comments
Open

Return -DPIC with pkg-config --cflags alsa when appropriate #289

afq984 opened this issue Dec 31, 2022 · 2 comments

Comments

@afq984
Copy link

afq984 commented Dec 31, 2022

Some build systems (we are using bazel) do not define -DPIC when compiling position independent objects.

When building a alsa module, if PIC is not defined, global.h requires the presence of the snd_dlsym_start symbol, which is absent from libasound.so if alsa itself is built with -DPIC.

extern struct snd_dlsym_link *snd_dlsym_start;

If the PIC macro is non-standard I would suggest exposing it via pkg-config so position independent alsa modules can pick up the flag and apply it to the alsa headers appropriately.

@perexg
Copy link
Member

perexg commented Jan 5, 2023

It's a third-party module ? This flag is set by configure (libtool) and it is not required for the standard alsa-lib apps (except the modules). I would suggest to add #define PIC 1 line to the third-party module source or build rules.

@afq984
Copy link
Author

afq984 commented Jan 6, 2023

yeah we're building an alsa plugin for our audio server (CRAS). We currently add -DPIC to our build rules, and I'm wondering if it make sense for this to exposed from pkg-config.
If you think nothing needs to be changed feel free to close this, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants