Skip to content

[PATCH v3] m4: dpdk: fix DPDK_LIBS generation with pkgconf >= 1.9.4 #241

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

Conversation

janzizazizka
Copy link

The pkgconf older then 1.9.4 was adding extra space at the end of printed configuration elements. This was changed with [1].

With pkgconf 1.9.4 onwards the generated DPDK_LIBS creates '-ldl-latomic' instaed of '-ldl,-latomic' causing that linking fails.

To fix this append ',' always if missing at the end. The change is backwards compatible and works with both old and new pkgconf.

[1] pkgconf/pkgconf@648a224

@odpbuild odpbuild changed the title m4: dpdk: fix DPDK_LIBS generation with pkgconf >= 1.9.4 [PATCH v1] m4: dpdk: fix DPDK_LIBS generation with pkgconf >= 1.9.4 Dec 19, 2023
@janzizazizka janzizazizka force-pushed the fix-new-pkgconf-support branch from 085bfb0 to 4fb1d88 Compare December 19, 2023 16:19
@odpbuild odpbuild changed the title [PATCH v1] m4: dpdk: fix DPDK_LIBS generation with pkgconf >= 1.9.4 [PATCH v2] m4: dpdk: fix DPDK_LIBS generation with pkgconf >= 1.9.4 Dec 19, 2023
@janzizazizka
Copy link
Author

There seems to be many checks failing :-) but I cannot see how this change could cause those. I'll try to reproduce some of them locally to see if my change introduced a regression:

 gcc -W -Wall -Werror -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wformat-truncation=0 -Wformat-overflow=0 -std=c11 -D_GNU_SOURCE  -mcx16 -march=native  -Wno-error=cast-align  -include rte_config.h -march=corei7 -I/usr/local/include -D_GNU_SOURCE -msse4.2 -DALLOW_EXPERIMENTAL_API -g -O2 odp_api_headers.c -o odp_api_headers_shared \
	`PKG_CONFIG_PATH=/opt/odp/lib/pkgconfig:$PKG_CONFIG_PATH pkg-config --cflags --libs libodphelper` `PKG_CONFIG_PATH=/opt/odp/lib/pkgconfig:$PKG_CONFIG_PATH pkg-config --cflags --libs libodp-dpdk`
/usr/bin/ld: cannot find : No such file or directory

@janzizazizka
Copy link
Author

OK thanks @MatiasElo for pointing out the regression. I'll need to revisit the change, my bad.

The pkgconf older then 1.9.4 was adding extra space at the end of
printed configuration elements. This was changed with [1].

With pkgconf 1.9.4 onwards the generated DPDK_LIBS creates
'-ldl-latomic' instaed of '-ldl,-latomic' causing that linking
fails.

To fix this append ',' always if missing at the end. The change
is backwards compatible and works with both old and new pkgconf.

Note that there is difference between pkgconf and pkg-config
projects. The pkg-config 0.29.2 still has trailing space.
The pkg-config is used by .deb family of distros. The pkgconf
is used by .rpm family of distros.

[1] pkgconf/pkgconf@648a224

Signed-off-by: Jan Zizka <jan.zizka@nokia.com>
@janzizazizka janzizazizka force-pushed the fix-new-pkgconf-support branch from 4fb1d88 to 7c18665 Compare December 20, 2023 12:51
@odpbuild odpbuild changed the title [PATCH v2] m4: dpdk: fix DPDK_LIBS generation with pkgconf >= 1.9.4 [PATCH v3] m4: dpdk: fix DPDK_LIBS generation with pkgconf >= 1.9.4 Dec 20, 2023
@janzizazizka
Copy link
Author

Found the regression. Touched one place too much where training , should not be added. Also noticed difference between pkgconf and pkg-config projects.

@janzizazizka
Copy link
Author

Thanks to @MatiasElo it was discovered that the problem was caused by accidental edit of libodp-dpdk.pc.in so this MR was fixing just a symptom of the problem.

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