Skip to content

Commit ec84cc0

Browse files
committed
Fix -lcrypt via LIBRARY_PATH after CMAKE_EXE_LINKER_FLAGS still didn't reach comist
Second attempt: passing -DCMAKE_EXE_LINKER_FLAGS on the configure line hit the identical "cannot find -lcrypt" failure at the exact same target, so comist's CMakeLists.txt evidently doesn't inherit that cache variable either. LIBRARY_PATH is read directly by gcc/gfortran's own collect2 link driver regardless of what flags the build system passes on the command line, so it can't be dropped the same way.
1 parent 770890b commit ec84cc0

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

recipe/build.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ export CMAKE_POLICY_VERSION_MINIMUM=3.5
66

77
# Several targets' own link steps (kuesvr/cdmove, pawlib/comis/test/comist)
88
# drop -L$PREFIX/lib, so -lcrypt can't find libxcrypt's libcrypt.so even
9-
# though it's a host: dependency and correctly installed. Plain `export
10-
# LDFLAGS` isn't enough -- CMake only seeds CMAKE_EXE_LINKER_FLAGS_INIT
11-
# from env LDFLAGS on a truly fresh configure, and some per-target link
12-
# rules here don't inherit it anyway. Pass it straight into CMake's own
13-
# linker-flags cache variable so every target gets it regardless.
9+
# though it's a host: dependency and correctly installed. Neither plain
10+
# `export LDFLAGS` nor -DCMAKE_EXE_LINKER_FLAGS on the configure line
11+
# reach comist's link step (its CMakeLists.txt likely sets its own
12+
# LINK_FLAGS/link_libraries that don't inherit the global ones). The one
13+
# thing every linker invocation genuinely can't ignore is LIBRARY_PATH --
14+
# gcc/gfortran/collect2 append it to their own -L search dirs regardless
15+
# of what the build system generated on the command line.
1416
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib -Wl,-rpath,${PREFIX}/lib"
17+
export LIBRARY_PATH="${PREFIX}/lib${LIBRARY_PATH:+:$LIBRARY_PATH}"
1518
CRYPT_LDFLAGS="-L${PREFIX}/lib -Wl,-rpath,${PREFIX}/lib"
1619

1720
mkdir -p build-scripts

0 commit comments

Comments
 (0)