MulleWeb / mulle-markdown

👯 mulle-markdown turns markdown into HTML (as a static executable)
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Linking issue with -fuse-ld=bfd #2

Closed wenq1 closed 1 year ago

wenq1 commented 1 year ago

[100%] Linking C executable mulle-markdown
/opt/homebrew/Cellar/cmake/3.26.2/bin/cmake -E cmake_link_script CMakeFiles/mulle-markdown.dir/link.txt --verbose=1
/Users/wc/scratch/mulle/bin-release/mulle-clang-project/14.0.6.2/bin/mulle-clang -I/Users/wc/scratch/mulle/usr/include  -Wno-parentheses   -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=12.2 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -fuse-ld=bfd "CMakeFiles/_1_mulle-markdown.dir/src/main.m.o" -o mulle-markdown  /Users/wc/scratch/mulle/usr/lib/libMulleHoedown.a -force_load /Users/wc/scratch/mulle/usr/lib/libMulleHoedown.a /Users/wc/scratch/mulle/usr/lib/libMulleObjCValueFoundation.a -force_load /Users/wc/scratch/mulle/usr/lib/libMulleObjCValueFoundation.a /Users/wc/scratch/mulle/usr/lib/libMulleObjC.a -force_load /Users/wc/scratch/mulle/usr/lib/libMulleObjC.a /Users/wc/scratch/mulle/usr/lib/libmulle-sprintf.a -force_load /Users/wc/scratch/mulle/usr/lib/libmulle-sprintf.a /Users/wc/scratch/mulle/usr/lib/libmulle-objc-runtime.a -force_load /Users/wc/scratch/mulle/usr/lib/libmulle-objc-runtime.a /Users/wc/scratch/mulle/usr/lib/libmulle-container.a /Users/wc/scratch/mulle/usr/lib/libmulle-fprintf.a /Users/wc/scratch/mulle/usr/lib/libmulle-buffer.a /Users/wc/scratch/mulle/usr/lib/libmulle-allocator.a /Users/wc/scratch/mulle/usr/lib/libmulle-data.a /Users/wc/scratch/mulle/usr/lib/libmulle-utf.a /Users/wc/scratch/mulle/usr/lib/libmulle-vararg.a /Users/wc/scratch/mulle/usr/lib/libmulle-thread.a /Users/wc/scratch/mulle/usr/lib/libmulle-multififo.a /Users/wc/scratch/mulle/usr/lib/libmulle-concurrent.a /Users/wc/scratch/mulle/usr/lib/libmulle-aba.a /Users/wc/scratch/mulle/usr/lib/libmulle-dlfcn.a /Users/wc/scratch/mulle/usr/lib/libmulle-objc-debug.a /Users/wc/scratch/mulle/usr/lib/libmulle-atinit.a -force_load /Users/wc/scratch/mulle/usr/lib/libmulle-atinit.a /Users/wc/scratch/mulle/usr/lib/libmulle-atexit.a -force_load /Users/wc/scratch/mulle/usr/lib/libmulle-atexit.a /Users/wc/scratch/mulle/usr/lib/libMulleObjC-startup.a -force_load /Users/wc/scratch/mulle/usr/lib/libMulleObjC-startup.a /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libpthread.tbd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libdl.tbd 

Btw if it is using musl, is it supposed to work on Darwin? I think probably no.

wenq1 commented 1 year ago

I removed this and it works on Darwin. Maybe -fuse-ld=bfd should be wrapped inside linux platform? Like

if (LINUX)

# if( LINK_PHASE)
#    target_link_options( "${EXECUTABLE_LINK_TARGET}" PUBLIC -fuse-ld=bfd)
# endif()

endif ()
mulle-nat commented 1 year ago

I didn't expect musl to work on Apple at all. I probably would negate that and say if( NOT APPLE), because "bfd" isn't linux only I think.

wenq1 commented 1 year ago

That sounds good. And freebsd guys will be more happy if so.

mulle-nat commented 1 year ago

If you can make a pull request out of this, it'd be appreciated (then I don't have to search for the correct cmake file :laughing: )