Project

General

Profile

Issue #798

MAC OSX Compile - libbliss error

Added by Steven Lacroix almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
build
Affected version:
5.2.1
Resolution:

Description

I'm trying to compile from source on Mac OSX Yosemity. with this config as state here: https://wiki.strongswan.org/projects/strongswan/wiki/MacOSX

With this config: ./configure --disable-kernel-netlink --enable-kernel-pfroute --enable-kernel-libipsec --disable-gmp --enable-openssl --enable-osx-attr --disable-scripts --with-lib-prefix=/opt/local

Getting this error:

/bin/sh ../../../../libtool  --tag=CC   --mode=link gcc   -g -O2 -Wall -Wno-format -Wno-format-security -Wno-pointer-sign -include /Users/sjlacoix/Documents/android/Workspace/strongswan/config.h  -L/opt/local/lib -o bliss_huffman bliss_huffman.o -lm libbliss-params.la 
libtool: link: gcc -g -O2 -Wall -Wno-format -Wno-format-security -Wno-pointer-sign -include /Users/sjlacoix/Documents/android/Workspace/strongswan/config.h -o bliss_huffman bliss_huffman.o  -L/opt/local/lib -lm ./.libs/libbliss-params.a
Undefined symbols for architecture x86_64:
  "_builtin_fprintf", referenced from:
      _main in bliss_huffman.o
  "_builtin_printf", referenced from:
      _main in bliss_huffman.o
      _write_node in bliss_huffman.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [bliss_huffman] Error 1
make[3]: *** [distdir] Error 1
make[2]: *** [distdir] Error 1
make[1]: *** [distdir] Error 1
make: *** [dist] Error 2

Related issues

Related to Bug #812: bliss plugin cannot be cross-compiledClosed05.01.2015

History

#1 Updated by Tobias Brunner almost 6 years ago

  • Status changed from New to Feedback
  • Assignee set to Tobias Brunner

I suppose you executed make distdir or similar as otherwise the bliss plugin would get ignored, unless explicitly enabled with --enable-bliss.

As far as that error is concerned, it is caused because libstrongswan's library.h is included in bliss_huffman.c despite the fact that libstrongswan is not actually linked to bliss_huffman. Therefore, the replacements for fprintf/printf we use on Mac OS X (for custom printf format specifiers) can not be found. To fix this you may apply the following patch:

diff --git a/src/libstrongswan/plugins/bliss/bliss_huffman.c b/src/libstrongswan/plugins/bliss/bliss_huffman.c
index a26c894..a3e5359 100644
--- a/src/libstrongswan/plugins/bliss/bliss_huffman.c
+++ b/src/libstrongswan/plugins/bliss/bliss_huffman.c
@@ -17,6 +17,8 @@
 #include "bliss_param_set.h" 

 #include <library.h>
+#undef fprintf
+#undef printf

 #include <stdio.h>
 #include <math.h>

#2 Updated by Tobias Brunner over 5 years ago

  • Related to Bug #812: bliss plugin cannot be cross-compiled added

#3 Updated by Tobias Brunner over 5 years ago

  • Category set to build
  • Status changed from Feedback to Closed

With the measures taken to fix #812 this should be fixed too, as bliss_huffman is usually not required anymore.

Also available in: Atom PDF