Skip to content

Commit

Permalink
ports-mgmt/pkg-*: fix symbol collisions
Browse files Browse the repository at this point in the history
while we fixed the symbol collision between libmd and libcrypto long
ago in dynamic linked program, the collision is still there somehow for
statically build programs.

The manual check for liblzma_libs for static linking that was added long
ago brings in a link to libmd before a link to libcrypto (this is since
FreeBSD 13.0+

This manual check is not necessary anymore anyway, so let's drop it.

Reported by:	Franco Fitchner (from Opnsense)
  • Loading branch information
bapt committed Jan 20, 2022
1 parent 696a89a commit 08342c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
12 changes: 1 addition & 11 deletions ports-mgmt/pkg-devel/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PORTNAME= pkg
DISTVERSION= 1.17.99.9
PORTREVISION= 1
_PKG_VERSION= ${DISTVERSION}
CATEGORIES= ports-mgmt
PKGNAMESUFFIX= -devel
Expand Down Expand Up @@ -43,13 +44,6 @@ CONFIGURE_ARGS+= --with-asan --with-ubsan
#CONFIGURE_ARGS+= --default-format=tzst
#.endif

.if !exists(/usr/libdata/pkgconfig/liblzma.pc)
LIBLZMA_LIBS= -llzma
.else
LIBLZMA_PC!= ${EGREP} ^Libs /usr/libdata/pkgconfig/liblzma.pc
LIBLZMA_LIBS= ${LIBLZMA_PC:M-l*}
.endif

.if defined(WITH_PKG)
.if ${WITH_PKG} != devel
. if !defined(PACKAGE_BUILDING)
Expand All @@ -67,10 +61,6 @@ PKG_DEPENDS=
PKG_BIN= ${WRKSRC}/src/pkg-static
.endif

post-patch:
${REINPLACE_CMD} -e "s|-llzma|${LIBLZMA_LIBS}|g" ${WRKSRC}/auto.def \
${WRKSRC}/src/Makefile.autosetup ${WRKSRC}/tests/Makefile.autosetup

.if ${PORT_OPTIONS:MSAN}
post-build:
@(cd ${WRKSRC}/src && \
Expand Down
12 changes: 1 addition & 11 deletions ports-mgmt/pkg/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PORTNAME= pkg
DISTVERSION= 1.17.5
PORTREVISION= 1
_PKG_VERSION= ${DISTVERSION}
CATEGORIES= ports-mgmt
#MASTER_SITES= \
Expand Down Expand Up @@ -70,13 +71,6 @@ pre-everything::
.endif
.endif

.if !exists(/usr/libdata/pkgconfig/liblzma.pc)
LIBLZMA_LIBS= -llzma
.else
LIBLZMA_PC!= ${EGREP} ^Libs /usr/libdata/pkgconfig/liblzma.pc
LIBLZMA_LIBS= ${LIBLZMA_PC:M-l*}
.endif

#define PKG_DEPENDS to nothing to avoid infinite loop looking for pkg :)
PKG_DEPENDS=
.undef INSTALLS_DEPENDS
Expand All @@ -87,10 +81,6 @@ PKG_DEPENDS=
PKG_BIN= ${WRKSRC}/src/pkg-static
.endif

post-patch:
${REINPLACE_CMD} -e "s|-llzma|${LIBLZMA_LIBS}|g" ${WRKSRC}/auto.def \
${WRKSRC}/src/Makefile.autosetup ${WRKSRC}/tests/Makefile.autosetup

post-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/compat/pkg

Expand Down

0 comments on commit 08342c9

Please sign in to comment.