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

nco fails to build when compiling with "--no-undefined -Wl" as ld flags #270

Open
david-geiger opened this issue May 21, 2023 · 1 comment

Comments

@david-geiger
Copy link

Hi,

On Mageia Linux we compile with "--no-undefined -Wl" as ld flags per default but nco fails to build with the following underlinking issue:

/usr/bin/ld: /home/david/mgarepo/03_Plasma/nco/BUILD/nco-5.1.6/src/nco/nco_cln_utl.c:689: undefined reference to `nco_prg_nm_get'

Attached full build log:
log.nco.txt

@czender
Copy link
Member

czender commented May 21, 2023

NCO defines some one-liner functions that access global variables, like nco_prg_nm_get(), in a part of the nco.h header only visible to source files that include main(), e.g., ncks.c. Thus the library contains only the function prototype, not the function definition. We would need a PR to refactor the nco.h header, and probably all the source files that contain main(), in order for --no-undefined -Wl to succeed. I was never sure of the best way to handle access to global variables by the library. Hopefully a volunteer will figure out a solution that is still moderately elegant and avoids redundant code.

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

No branches or pull requests

2 participants