pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/54363: archivers/libcomprex failed to build on macosx



>Number:         54363
>Category:       pkg
>Synopsis:       archivers/libcomprex failed to build on macosx
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 09 14:00:00 +0000 2019
>Originator:     clement bouvier
>Release:        current
>Organization:
>Environment:
Macosx Mojave 10.14.5
>Description:
archivers/libcomprex failed to build under macosx because of undefined symbol in the module part of the project.

libtool: link: clang  -o .libs/libar.so -bundle  .libs/ar.o .libs/header.o .libs/utils.o   -L/Users/cbouvier/prj/pkgsrc/archivers/libcomprex/work/.buildlink/lib /Users/cbouvier/prj/pkgsrc/archivers/libcomprex/work/.buildlink/lib/libintl.dylib -lc -liconv  -O2  
Undefined symbols for architecture x86_64:
  "_cxClose", referenced from:
      _saveArchive in ar.o
  "_cxDestroyFsIterator", referenced from:
      _saveArchive in ar.o
  "_cxDirAddFile", referenced from:
      _readArchive in ar.o
  "_cxGetArchiveRoot", referenced from:
      _readArchive in ar.o
  "_cxGetFileArchive", referenced from:
      _openFile in ar.o
      ___readFunc in ar.o
  "_cxGetFileCompressedSize", referenced from:
      ___readFunc in ar.o
      ___seekFunc in ar.o
  "_cxGetFileDate", referenced from:
      _saveArchive in ar.o
  "_cxGetFileGid", referenced from:
      _saveArchive in ar.o
  "_cxGetFileMode", referenced from:
      _saveArchive in ar.o
  "_cxGetFileName", referenced from:
      _saveArchive in ar.o
  "_cxGetFilePhysicalPath", referenced from:
      _saveArchive in ar.o
  "_cxGetFileSize", referenced from:
      _readArchive in ar.o
      _saveArchive in ar.o
  "_cxGetFileUid", referenced from:
      _saveArchive in ar.o
  "_cxGetFsIterFirst", referenced from:
      _saveArchive in ar.o
  "_cxGetFsIterNext", referenced from:
      _saveArchive in ar.o
  "_cxGetFsNodeType", referenced from:
      _saveArchive in ar.o
  "_cxNewFile", referenced from:
      _readArchive in ar.o
  "_cxNewFp", referenced from:
      _openFile in ar.o
  "_cxNewFsIterator", referenced from:
      _saveArchive in ar.o
  "_cxOpenFile", referenced from:
      _saveArchive in ar.o
  "_cxRead", referenced from:
      _readArchive in ar.o
      _saveArchive in ar.o
      ___readFunc in ar.o
      _cxArValidateMagic in header.o
      _cxArReadHeader in header.o
  "_cxRegisterModule", referenced from:
      _initComprexModule in ar.o
  "_cxSeek", referenced from:
      _readArchive in ar.o
      _openFile in ar.o
      ___readFunc in ar.o
  "_cxSetArchiveType", referenced from:
      _readArchive in ar.o
  "_cxSetCloseFunc", referenced from:
      _openFile in ar.o
  "_cxSetFileCompressedSize", referenced from:
      _readArchive in ar.o
  "_cxSetFileDate", referenced from:
      _readArchive in ar.o
  "_cxSetFileGid", referenced from:
      _readArchive in ar.o
  "_cxSetFileMode", referenced from:
      _readArchive in ar.o
  "_cxSetFileName", referenced from:
      _readArchive in ar.o
  "_cxSetFileSize", referenced from:
      _readArchive in ar.o
  "_cxSetFileUid", referenced from:
      _readArchive in ar.o
  "_cxSetReadFunc", referenced from:
      _openFile in ar.o
  "_cxSetSeekFunc", referenced from:
      _openFile in ar.o
  "_cxSetWriteFunc", referenced from:
      _openFile in ar.o
  "_cxTell", referenced from:
      _readArchive in ar.o
      ___readFunc in ar.o
  "_cxWrite", referenced from:
      _saveArchive in ar.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

More details are available on the Joyent MacOS build
http://useast.manta.joyent.com/pkgsrc/public/reports/Darwin/trunk/x86_64/20190707.1543/libcomprex-0.3.3nb18/build.log
>How-To-Repeat:
build archivers/libcomprex
>Fix:
The project has plugin code to load into the library at runtime (The plugin part is under modules).

The linker need to know that some symbols in the plugin part (Theses symbols are in the core lib comprex ) will be resolved at runtime during the loading of the module.
The macOS linker uses -undefined dynamic_lookup flags.
The patch remplaces -no-undefined flags by the previous one.

It is pretty hard to test the functionnality; indeed the project is pretty old and the tests are not so useful(there is no news in the mailing list since 2003!). However I obtain the same behaviors as the same code under netbsd-8 with gcc with the tests.

I wonder if the project is till used...but anyway we can build it....

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/archivers/libcomprex/Makefile,v
retrieving revision 1.41
diff -u -r1.41 Makefile
--- Makefile	1 Jul 2019 04:07:44 -0000	1.41
+++ Makefile	9 Jul 2019 13:51:22 -0000
@@ -18,6 +18,20 @@
 CONFIGURE_ENV+=		ac_cv_lib_curl_curl_formparse=yes
 REPLACE_SH=		comprex-config.in
 
+.include "../../mk/bsd.prefs.mk"
+
+# macos linker need to know that undefined symbols are resolved 
+# at runtime during the loading of plugin code
+.if ${OPSYS} == "Darwin"
+SUBST_CLASSES+=         plugins
+SUBST_STAGE.plugins=     pre-configure
+SUBST_MESSAGE.plugins=   allow comprex symbols to be resolved at runtime  
+SUBST_FILES.plugins=     modules/archive/ar/Makefile.in modules/archive/bzip2/Makefile.in modules/archive/cab/Makefile.in \
+                         modules/archive/cpio/Makefile.in modules/archive/tar/Makefile.in modules/archive/zip/Makefile.in \
+                         modules/archive/zlib/Makefile.in modules/scheme/curl/Makefile.in
+SUBST_SED.plugins=       -e 's,-no-undefined,-undefined dynamic_lookup,g'
+.endif
+
 .include "../../archivers/bzip2/buildlink3.mk"
 .include "../../devel/gettext-lib/buildlink3.mk"
 .include "../../www/curl/buildlink3.mk"



Home | Main Index | Thread Index | Old Index