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

Move atomic_ops libs into Requires.private #656

Closed
wants to merge 1 commit into from

Conversation

fundawang
Copy link
Contributor

@fundawang fundawang commented Aug 27, 2024

Acturally, bdwgc it self may requires atomic_ops, but it does not require downstream packages (like guile) requires atomic_ops. So I would suggest that move @ATOMIC_OPS_LIBS@ into Requires.private, so that won't confuse downstream packages, especially when performing check.

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

My library z uses libx internally, but does not expose libx data types in its public API. What do I put in my z.pc file?
Again, add the module to Requires.private if it supports pkg-config. In this case, the compiler flags will be emitted unnecessarily, but it ensures that the linker flags will be present when linking statically. If libx does not support pkg-config, add the necessary linker flags to Libs.private.

So I think, move atomic_ops is a more appropriate solution.

@ivmai
Copy link
Owner

ivmai commented Aug 27, 2024

Please rebase to fresh master and explain the difference from the previous PR I just merged.

@@ -197,6 +198,7 @@ if (enable_threads)
"with_libatomic_ops and without_libatomic_ops are mutually exclusive")
endif()
set(ATOMIC_OPS_LIBS "-latomic_ops")
set(ATOMIC_OPS_PC "atomic_ops")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set ATOMIC_OPS_LIBS using value of ATOMIC_OPS_PC

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, update comment "ATOMIC_OPS_LIBS, PACKAGE_VERSION are defined above" below

@@ -1207,7 +1207,9 @@ AS_IF([test x"$with_libatomic_ops" != xno],
[AS_IF([test x"$with_libatomic_ops" != xnone -a x"$THREADS" != xnone],
[AC_MSG_RESULT([external])
ATOMIC_OPS_LIBS="-latomic_ops"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define ATOMIC_OPS_LIBS based on ATOMIC_OPS_PC value.

AC_SUBST([ATOMIC_OPS_LIBS])],
ATOMIC_OPS_PC="atomic_ops"
AC_SUBST([ATOMIC_OPS_LIBS])
AC_SUBST([ATOMIC_OPS_PC])],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also define ATOMIC_OPS_PC="" below (for internal "internal" case)

@fundawang
Copy link
Contributor Author

I suddenly realized a problem. atomic_ops shipped atomic_ops.pc starting from 7.2. If bdwgc is built upon atomic_ops 7.1, then we should not put it in bdwgc.pc file, because there is no atomic_ops.pc at that time.

Maybe we should leave it into Libs.private for now, till the time of bdwgc relies on atomic_ops >= 7.2.

@ivmai
Copy link
Owner

ivmai commented Aug 29, 2024

Maybe we should leave it into Libs.private for now, till the time of bdwgc relies on atomic_ops >= 7.2.

Although, 7.1 or 7.2 is not hard-coded in bdwgc source. I agree that we could leave this change for the future - I will create the relevant issue and close this PR.

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.

2 participants