News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

FTBFS on MacOSX since r13594

Started by kencu, January 02, 2025, 03:03:21 AM

Previous topic - Next topic

kencu

error is:


/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:


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.

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

kencu


kencu

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



stahta01

Quote from: kencu 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

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.


if DARWIN
..._LDFLAGS += -framework Security
endif

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

kencu

#5
good suggestion.

Adding this did work also:


--- 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 \

kencu

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.