Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion pkgs/stdenv/generic/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,18 @@ patchPhase() {


fixLibtool() {
sed -i -e 's^eval sys_lib_.*search_path=.*^^' "$1"
local search_path
for flag in $NIX_LDFLAGS; do
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to account for the role here? If libtool is ever used in depsBuildBuild we need to look into a different variable or does that never happen?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not 100%, but I don't think so — remember, libtool isn't a dependency we're providing (and when we are providing it, all that it's doing is generating the script this applies to), so I don't think it makes sense to think of it in any role but host. What do you think
?

Copy link
Member

Choose a reason for hiding this comment

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

Right, the question then becomes: Are there other search paths (for build and target, maybe) we should take care of as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean other paths libtool looks at? I don't think so — when linking a proogram, it looks at two paths specific to the program being linked, sys_lib_search_path (what we're using here), and LD_LIBRARY_PATH.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I see. What's matched by sys_lib_.+search_path?

Copy link
Member Author

Choose a reason for hiding this comment

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

sys_lib_dlsearch_path. I'm not sure what it does, but it's not used in the same way as the other paths.

case $flag in
-L*)
search_path+=" ${flag#-L}"
;;
esac
done

sed -i "$1" \
-e "s^eval \(sys_lib_search_path=\).*^\1'$search_path'^" \
-e 's^eval sys_lib_.+search_path=.*^^'
}


Expand Down