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

Incomplete pkg-config for static linking #1918

Closed
dridi opened this issue Sep 28, 2018 · 3 comments
Closed

Incomplete pkg-config for static linking #1918

dridi opened this issue Sep 28, 2018 · 3 comments
Assignees
Labels
3.x Related to ModSecurity version 3.x enhancement RIP - libmodsecurity
Projects
Milestone

Comments

@dridi
Copy link

dridi commented Sep 28, 2018

Hello,

I tried to build the v3/master branch today to attempt a static linking of libmodsecurity in an autotools project. While this works fine, ultimately when I try to run the executable I get this:

dlerror: undefined symbol: xmlFree

After a quick look at your modsecurity.pc file I realized that the private dependencies are missing. You should at least advertise Libs.private for linking and maybe Requires.private if some of your dependencies' API leak into your own headers (eg. a type from another library).

I'm only reporting this and not submitting a patch because you have optional dependencies so I'm not sure how to best piece it together.

More info on static linking and private dependencies:

https://people.freedesktop.org/~dbn/pkg-config-guide.html#writing

cc @gquintard

@victorhora victorhora self-assigned this Sep 28, 2018
@victorhora victorhora added enhancement RIP - libmodsecurity 3.x Related to ModSecurity version 3.x labels Sep 28, 2018
@victorhora
Copy link
Contributor

Hey @dridi

Thanks for your report. As far as I can recall, only PCRE is mandatory now.

The remainder of dependencies (GeoIP/MaxMind, libcURL, YAJL, LBMD, Lua and Ssdeep) are all optional.

That being said, I believe there should be a way to allow the .pc file to support both dynamically and statically linking. Do you want to submit a pull request? :)

@victorhora victorhora added this to the v3.0.4 milestone Sep 28, 2018
@dridi
Copy link
Author

dridi commented Oct 1, 2018

I can't promise a patch, but I would definitely help review it.

@victorhora
Copy link
Contributor

victorhora commented Oct 1, 2018

Sounds good. This improvement is tagged for the 3.0.4 release. Thanks!

@zimmerle zimmerle added this to To do in v3.0.4 via automation Nov 30, 2018
@zimmerle zimmerle added this to To do in v3.1.0 via automation Oct 15, 2019
@zimmerle zimmerle removed this from To do in v3.0.4 Oct 15, 2019
v3.1.0 automation moved this from Backlog to Done Feb 4, 2020
mtorromeo pushed a commit to artera/rpm-libmodsecurity that referenced this issue Jul 13, 2020
This file is currently not fit for static linking but upstream is aware
and working on it:

    owasp-modsecurity/ModSecurity#1918
vladbukin pushed a commit to vladbukin/ModSecurity that referenced this issue Apr 12, 2022
Add Libs.private to save static dependencies so applications linking
statically with modsecurity will be able to retrieve them through
pkg-config

Fix owasp-modsecurity#1918

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x enhancement RIP - libmodsecurity
Projects
v3.1.0
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants