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

build: Use LDADD instead of LDFLAGS for libcommon.la. #130

Merged
merged 1 commit into from
Aug 13, 2021

Conversation

orbea
Copy link
Contributor

@orbea orbea commented Mar 16, 2021

When building pdsh with slibtool (https://dev.midipix.org/cross/slibtool) it fails with many undefined references.

This is because of this command-line:

clang ../../src/common/.libs/libcommon.a main.o dsh.o mod.o rcmd.o opt.o 
privsep.o pcp_server.o pcp_client.o testcase.o wcoll.o cbuf.o config.o -O3 
-Wall -fno-strict-aliasing -ldl -s -pthread -o .libs/pdsh.inst -Wl,--export-dynamic

While with GNU libtool it works.

clang -O3 -Wall -fno-strict-aliasing -s -pthread -o pdsh.inst main.o dsh.o 
mod.o rcmd.o opt.o privsep.o pcp_server.o pcp_client.o testcase.o wcoll.o 
cbuf.o config.o -Wl,--export-dynamic  -ldl ../../src/common/.libs/libcommon.a -pthread

This is because by chance GNU libtool orders ../../src/common/.libs/libcommon.a at the end while slibtool places it at the beginning. This happens because src/pdsh/Makefile.am uses LDFLAGS instead of LDADD for ../../src/common/.libs/libcommon.a, when using LDADD instead it is explicitly placed at the end and the build succeeds.

Here is a build log for reference: pdsh.slibtool.log
GNU libtool log: pdsh.libtool.log

Also see this downstream issue: https://bugs.gentoo.org/775593

grondo
grondo previously approved these changes Aug 13, 2021
Copy link
Member

@grondo grondo left a comment

Choose a reason for hiding this comment

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

Sorry for leaving this to languish!

This change looks good to me. Do you mind if I rebase to get CI checks to run (though I don't anticipate any problems, we like to rebase and merge anyway)

@mergify mergify bot dismissed grondo’s stale review August 13, 2021 17:52

Approving reviews have been dismissed because this pull request
was updated.

@orbea
Copy link
Contributor Author

orbea commented Aug 13, 2021

Do you mind if I rebase to get CI checks to run

I don't mind at all, but I rebased it myself since that was low effort.

@grondo
Copy link
Member

grondo commented Aug 13, 2021

Excellent, thanks!

@codecov-commenter
Copy link

Codecov Report

Merging #130 (49dfc7d) into master (228a1ca) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #130   +/-   ##
=======================================
  Coverage   63.81%   63.81%           
=======================================
  Files          27       27           
  Lines        5585     5585           
=======================================
  Hits         3564     3564           
  Misses       2021     2021           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 228a1ca...49dfc7d. Read the comment docs.

Copy link
Member

@grondo grondo left a comment

Choose a reason for hiding this comment

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

LGTM, and thanks for the fix!

@grondo grondo added the merge-when-passing Let mergify auto-rebase and merge when CI passes label Aug 13, 2021
@mergify mergify bot merged commit 0784020 into chaos:master Aug 13, 2021
@orbea orbea deleted the slibtool branch August 13, 2021 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-when-passing Let mergify auto-rebase and merge when CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants