Skip to content

Commit

Permalink
mk: Fix REQUIRES generation for non-standard paths.
Browse files Browse the repository at this point in the history
The GCC packages were incorrectly generating REQUIRES for GCC runtime
libraries found under /usr/lib/amd64, because the REQUIRES handling did
not account for the paths that GCC uses to store its runtime libraries.

Instead of only looking in ${DESTDIR}${PREFIX}/lib, look under
${DESTDIR} first for all RPATH entries used by the target object.

GCC now correctly does not list any REQUIRES for its own libraries.
  • Loading branch information
Jonathan Perkin committed Nov 4, 2019
1 parent 51c5be6 commit f2b0855
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mk/pkgformat/pkg/metadata.mk
Expand Up @@ -71,11 +71,20 @@ ${_BUILD_INFO_FILE}: ${_PLIST_NOKEYWORDS}
dsolibs = dsolibs (dsolibs ? ":" : "") $$NF; \
} \
/RPATH/ { \
nrpath = split($$NF ":${DESTDIR}${PREFIX}/lib${LIBARCHSUFFIX}:${SYSTEM_DEFAULT_RPATH}", rpath, ":"); \
nrpath = split($$NF ":${SYSTEM_DEFAULT_RPATH}", rpath, ":"); \
nlibs = split(dsolibs, libs, ":"); \
for (l = 1; l <= nlibs; l++) { \
for (r = 1; r <= nrpath; r++) { \
sub(/\/$$/, "", rpath[r]); \
sub(/\/\.$$/, "", rpath[r]); \
libfile = "${DESTDIR}" rpath[r] "/" libs[l]; \
if (!(libfile in libcache)) { \
libcache[libfile] = system("test -f " libfile); \
} \
if (libcache[libfile] == 0) { \
print libfile; \
break; \
} \
libfile = rpath[r] "/" libs[l]; \
if (!(libfile in libcache)) { \
libcache[libfile] = system("test -f " libfile); \
Expand Down

0 comments on commit f2b0855

Please sign in to comment.