Author Topic: FTBFS on MacOSX since r13594  (Read 3610 times)

Offline kencu

  • Multiple posting newcomer
  • *
  • Posts: 12
FTBFS on MacOSX since r13594
« on: January 02, 2025, 03:03:21 am »
error is:

Code
/bin/sh ../../../../libtool  --tag=CXX   --mode=link /usr/bin/clang++ -std=gnu++11 -std=c++11  -pipe -I/opt/local/libexec/boost/1.76/include -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -Winvalid-pch -fPIC -fexceptions -dynamiclib -version-info 0:1:0 -no-undefined -avoid-version -L/opt/local/libexec/boost/1.76/lib -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -o libexporter.la -rpath /opt/local/lib/codeblocks/plugins BaseExporter.lo exporter.lo HTMLExporter.lo ODTExporter.lo PDFExporter.lo RTFExporter.lo ../../../sdk/libcodeblocks.la wxPdfDocument/libwxPdfDocument.la -L/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/lib   -framework IOKit -framework Carbon -framework Cocoa -framework QuartzCore -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_aui-3.2 -lwx_osx_cocoau_propgrid-3.2 -lwx_osx_cocoau_richtext-3.2 -lwx_osx_cocoau_xrc-3.2 -lwx_osx_cocoau_html-3.2 -lwx_osx_cocoau_qa-3.2 -lwx_osx_cocoau_core-3.2 -lwx_baseu_xml-3.2 -lwx_baseu_net-3.2 -lwx_baseu-3.2   -lpthread -ldl 
libtool: link: /usr/bin/clang++ -std=gnu++11 -dynamiclib  -o .libs/libexporter.dylib  .libs/BaseExporter.o .libs/exporter.o .libs/HTMLExporter.o .libs/ODTExporter.o .libs/PDFExporter.o .libs/RTFExporter.o   -Wl,-force_load,wxPdfDocument/.libs/libwxPdfDocument.a  -L/opt/local/libexec/boost/1.76/lib -L/opt/local/lib ../../../sdk/.libs/libcodeblocks.dylib -L/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/lib -framework IOKit -framework Carbon -framework Cocoa -framework QuartzCore -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_aui-3.2 -lwx_osx_cocoau_propgrid-3.2 -lwx_osx_cocoau_richtext-3.2 -lwx_osx_cocoau_xrc-3.2 -lwx_osx_cocoau_html-3.2 -lwx_osx_cocoau_qa-3.2 -lwx_osx_cocoau_core-3.2 -lwx_baseu_xml-3.2 -lwx_baseu_net-3.2 -lwx_baseu-3.2 -lpthread -ldl  -Os -stdlib=libc++ -arch arm64 -Wl,-headerpad_max_install_names -Wl,-syslibroot -Wl,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64   -framework IOKit -framework Carbon -framework Cocoa -framework QuartzCore -framework AudioToolbox -framework System -framework OpenGL -install_name  /opt/local/lib/codeblocks/plugins/libexporter.dylib 
Undefined symbols for architecture arm64:
  "_SecRandomCopyBytes", referenced from:
      entropy(void*, unsigned long) in libwxPdfDocument.a[44](random.o)
  "_kSecRandomDefault", referenced from:
      entropy(void*, unsigned long) in libwxPdfDocument.a[44](random.o)
ld: symbol(s) not found for architecture arm64

previously src/plugins/contrib/source_exporter/wxPdfDocument/Makefile.am.orig had this:

Code
if HOST_OSX
AM_LDFLAGS = -framework Security
endif

I tried various things, but I'm not that familiar with the code base, and what I tried didn't work... so for now I just added "-framework Security" to the project's LDFLAGS, which is inelegant, but worked.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7721
    • My Best Post
Re: FTBFS on MacOSX since r13594
« Reply #1 on: January 02, 2025, 03:27:50 am »
I have three guesses of the solution.

One I posted here
https://forums.codeblocks.org/index.php/topic,25921.msg176607.html#msg176607

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline kencu

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: FTBFS on MacOSX since r13594
« Reply #2 on: January 02, 2025, 05:48:04 am »
I will try that

Offline kencu

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: FTBFS on MacOSX since r13594
« Reply #3 on: January 02, 2025, 08:46:55 am »
even putting an unguarded

AM_LDFLAGS = -framework Security

in that Makefiile.am does not work to fix the build.

This does work:

LDFLAGS += -framework Security


and this does work too:

if DARWIN
LDFLAGS += -framework Security
endif



Offline stahta01

  • Lives here!
  • ****
  • Posts: 7721
    • My Best Post
Re: FTBFS on MacOSX since r13594
« Reply #4 on: January 02, 2025, 02:09:52 pm »
even putting an unguarded

AM_LDFLAGS = -framework Security

in that Makefiile.am does not work to fix the build.

This does work:

LDFLAGS += -framework Security


and this does work too:

if DARWIN
LDFLAGS += -framework Security
endif

My third guess is

Replace the "..._LDFLAGS" with the variable in makefile.am that ends in LDFLAGS; I am not certain which makefile.am is the correct one; but, one of the ones had an variable ending in LDFLAGS. Add the new code after that line. If there is no variable ending in LDFLAGS then the guarded code you posted might be the correct solution or if changing variable ending in LDFLAGS fails to work.

Code
if DARWIN
..._LDFLAGS += -framework Security
endif
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline kencu

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: FTBFS on MacOSX since r13594
« Reply #5 on: January 03, 2025, 06:44:42 pm »
good suggestion.

Adding this did work also:

Code
--- src/plugins/contrib/source_exporter/wxPdfDocument/Makefile.am.bak	2025-01-03 09:38:49
+++ src/plugins/contrib/source_exporter/wxPdfDocument/Makefile.am 2025-01-03 09:38:57
@@ -6,6 +6,10 @@
 
 libwxPdfDocument_la_LDFLAGS = @MODULE_SHARED_LDFLAGS@ -version-info 0:1:0 -no-undefined -avoid-version
 
+if DARWIN
+libwxPdfDocument_la_LDFLAGS += -framework Security
+endif
+
 libwxPdfDocument_la_SOURCES = \
  src/pdfannotation.cpp \
  src/pdfbarcode.cpp \
« Last Edit: January 03, 2025, 06:47:55 pm by kencu »

Offline kencu

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: FTBFS on MacOSX since r13594
« Reply #6 on: January 03, 2025, 06:46:06 pm »
there is some talk in an issue raised on sourceforge that the wxPDF crypto functions might not be needed at all, I note.... if they are completely removed, perhaps this framework would not then be needed.