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

Linux build attempt - running into -fPIC trouble #2

Open
ajjackson opened this issue Mar 18, 2022 · 2 comments · May be fixed by #3
Open

Linux build attempt - running into -fPIC trouble #2

ajjackson opened this issue Mar 18, 2022 · 2 comments · May be fixed by #3

Comments

@ajjackson
Copy link

I've had a go at building this on Linux. The standalone seems to build ok, but building VST3 with make AudioPluginExample_VST3 I'm consistently running into errors along the lines of

[100%] Linking CXX shared module "AudioPluginExample_artefacts/VST3/Daisy Plug-in Test.vst3/Contents/x86_64-linux/Daisy Plug-in Test.so"
/usr/bin/ld: DaisySP/libDaisySP.a(oscillator.cpp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

I've tried setting CFLAGS and CPPFLAGS to "-fPIC" in various places to no avail. Do you have any thoughts on where the -fPIC might need to be inserted?

@stephenhensley
Copy link
Collaborator

@ajjackson it looks like it wants DaisySP itself to be compiled with -fPIC as well.

You'll have to edit CMakeLists.txt file (or the resultant Makefile) to add it to the DaisySP CFLAGS and CXXFLAGS .

I think the actual in-repo DaisySP/Makefile is only set up for ARM Cross compilation.

I'm not sure I've tested this on Linux for the VST3, but I can probably slot out some time to confirm the VST3 build in general works sometime this week.

@ajjackson
Copy link
Author

Thanks for taking a look! I added -fPIC to CXXFLAGS in plugin/build/DaisySP/CMakeFiles/DaisySP.dir/flags.make and this allowed me to build a VST3 demo which loads in REAPER and makes the expected shrieking oscillator noise 🎉

I expect there's a cleaner / more automatic way of doing it, but this will get me going 😀

@dromer dromer linked a pull request Dec 22, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants