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

Makefile.am, configure.ac: fix hard coded static and include path #1026

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

vjardin
Copy link

@vjardin vjardin commented Nov 11, 2024

This serie is used to avoid hard coded path that do not work for any distributions. For instance, when buildroot is used or when cross compilation is used, the path of the headers cannot be enforce with /usr/include .

@vjardin
Copy link
Author

vjardin commented Nov 12, 2024

Side note : without this patch, it cannot link because
libmtcr_ul.a is not available, only libmtcr_ul.so (or its libmtcr_ul.la) had been compiled.

I do not understand why some -static are enforced while dynamic
linkage could be used.

We should not have any -static in order to be able to link
for the targets.
It is not compliant with cross compilation, it will lead to the
following:

aarch64-buildroot-linux-gnu-g++ -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2 -g0 -D_FORTIFY_SOURCE=1 -DHAVE_TERMIOS_H -DHAVE_SYS_PCI_H -isystem /usr/include/libxml2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 conftest.cpp
aarch64-buildroot-linux-gnu-g++: ERROR: unsafe header/library path used in cross-compilation: '-isystem' '/usr/include/libxml2'

configure.ac: proper probe libxml2

libxml2: CFLAGS and CXXFLAGS are used
Makefiles are not using xml_CFLAGS
the include path cannot be hardcoded with:
  /usr/include/curl/
engine is exported by openssl/engine.h ; if not, we can have some
compilation warnings of some undefined symbols.
@vjardin vjardin changed the title Makefile.am: fix non static linkage Makefile.am, configure.ac: fix hard coded static and include path Nov 14, 2024
Thanks to this definition, we'll be able to ave cleaner Makefiles.
the .so file should remain for the target when dynamic linkage is used.
If the file is removed, none of the applications will be loadable.
start using DYNAMIC in order to be aligned with the
  --enable-all-static
argument.
DPDK assumes that the library shall be into /usr/lib instead of /usr/lib/mstflint/
@vjardin
Copy link
Author

vjardin commented Nov 16, 2024

Meanwhile, this pull request is included with the Buildroot package until it'll become mainstream.
https://patchwork.ozlabs.org/project/buildroot/list/?series=433071

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 this pull request may close these issues.

1 participant