Skip to content

Restore pthread LDFLAG in examples #3229

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

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

eduar-hte
Copy link
Contributor

@eduar-hte eduar-hte commented Aug 14, 2024

what

Restore the pthread LDFLAG to build the following examples: multithread & reading_logs_with_offset

why

I removed this flag from the reading_logs_with_offset in commit 293cd21 after replacing usage of pthreads with C++'s std::thread. Additionally, I didn't add that flag either to the multithread example added in commit 4bf9616 for the same reason.

However, I'm getting the following error when building both of these projects in a Debian container:

/usr/bin/ld: multithread-multithread.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line

NOTE: It's curious that this doesn't happen when building the projects in all the non-Windows environments of the Quality Assurance workflow (which uses the same configuration) and thus wasn't detected before integrating PR #3216. 🤷‍♂️

Copy link

@marcstern marcstern added the 3.x Related to ModSecurity version 3.x label Aug 14, 2024
@airween
Copy link
Member

airween commented Aug 14, 2024

However, I'm getting the following error when building both of these projects in a Debian container:

/usr/bin/ld: multithread-multithread.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line

hmm, it's very interesting.

NOTE: It's curious that this doesn't happen when building the projects in all the non-Windows environments of the Quality Assurance workflow (which uses the same configuration) and thus wasn't detected before integrating PR #3216. 🤷‍♂️

Yes. When I saw you removed that LDFLAG I though it's a bit weird but the regression tests passed so it's no problem.

Btw here is a log snippet from the CI:

https://github.com/owasp-modsecurity/ModSecurity/actions/runs/10324047165/job/28582691805?pr=3216#step:9:873

And this is my build process (without applying this patch):

g++ -std=c++17 -DHAVE_CONFIG_H -I. -I../../src   -I../../headers -I../.. -g -I../others -fPIC -O3 -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/  -DWITH_MAXMIND -I/usr/include/x86_64-linux-gnu  -UNDEBUG  -DWITH_YAJL  -I/usr/include  -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3  -I/usr/include/libxml2  -DWITH_LIBXML2   -O0 -g -DWITH_PCRE2 -MT read-read.o -MD -MP -MF .deps/read-read.Tpo -c -o read-read.o `test -f 'read.cc' || echo './'`read.cc
mv -f .deps/read-read.Tpo .deps/read-read.Po
/bin/bash ../../libtool  --tag=CXX   --mode=link g++ -std=c++17  -O0 -g -DWITH_PCRE2 -L../../src/.libs/  -lmodsecurity -lm -lstdc++  -L/usr/lib/x86_64-linux-gnu/ -L/usr/lib/x86_64-linux-gnu/    -o read read-read.o -lcurl -lGeoIP  -lmaxminddb  -lrt   -lxml2  -llmdb  -llua5.3  -lfuzzy -lyajl  
libtool: link: g++ -std=c++17 -O0 -g -DWITH_PCRE2 -o .libs/read read-read.o  -L../../src/.libs/ /home/airween/src/ModSecurity/src/.libs/libmodsecurity.so -lm -lstdc++ -L/usr/lib/x86_64-linux-gnu/ -lcurl -lGeoIP -lmaxminddb -lrt -lxml2 -llmdb -llua5.3 -lfuzzy -lyajl

on a Debian SID.

@airween airween merged commit 752ab76 into owasp-modsecurity:v3/master Aug 14, 2024
49 checks passed
@eduar-hte eduar-hte deleted the pthread-makefile branch August 16, 2024 13:01
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants