Giter VIP home page Giter VIP logo

Comments (14)

krzyzanowskim avatar krzyzanowskim commented on May 23, 2024 9

I didn't do much research, who wants to make it happen?

from openssl.

chrisballinger avatar chrisballinger commented on May 23, 2024 2

Had some progress. This seems to be the magic trick: -target x86_64-apple-ios-macabi -miphoneos-version-min=13.0. Add it to CFLAGS and LDFLAGS.

from openssl.

chrisballinger avatar chrisballinger commented on May 23, 2024

I did some more digging, it looks like you use a subfolder in the MacOSX SDK with a x86_64-apple-ios13.0-macabi target. Here are some nuggets I found in the raw build logs for compiling a C file in a static lib:

Compiling

  • -target x86_64-apple-ios13.0-macabi
  • -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
  • -isystem /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/usr/include
  • -iframework /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/System/Library/Frameworks

Linking

  • -syslibroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
  • -L/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/usr/lib
  • -L/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/uikitformac
CompileC /Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/Objects-normal/x86_64/CrossTest.o /Users/xxxxxx/Desktop/Marzipan/CrossTwo/CrossTest.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler (in target: CrossTwo)
    cd /Users/xxxxxx/Desktop/Marzipan
    export LANG=en_US.US-ASCII
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -target x86_64-apple-ios13.0-macabi -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu11 -fmodules -fmodules-cache-path=/Users/xxxxxx/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/xxxxxx/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DDEBUG=1 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -index-store-path /Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Index/DataStore -iquote /Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/CrossTwo-generated-files.hmap -I/Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/CrossTwo-own-target-headers.hmap -I/Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/CrossTwo-all-non-framework-target-headers.hmap -ivfsoverlay /Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/all-product-headers.yaml -iquote /Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/CrossTwo-project-headers.hmap -I/Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Products/Debug-uikitformac/include -isystem /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/usr/include -I/Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/DerivedSources-normal/x86_64 -I/Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/DerivedSources/x86_64 -I/Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/DerivedSources -F/Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Products/Debug-uikitformac -iframework /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/System/Library/Frameworks -MMD -MT dependencies -MF /Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/Objects-normal/x86_64/CrossTest.d --serialize-diagnostics /Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/Objects-normal/x86_64/CrossTest.dia -c /Users/xxxxxx/Desktop/Marzipan/CrossTwo/CrossTest.c -o /Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/Objects-normal/x86_64/CrossTest.o

Libtool /Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Products/Debug-uikitformac/libCrossTwo.a normal x86_64 (in target: CrossTwo)
    cd /Users/xxxxxx/Desktop/Marzipan
    export MACOSX_DEPLOYMENT_TARGET=10.15
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -D -syslibroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -L/Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Products/Debug-uikitformac -L/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/usr/lib -L/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/uikitformac -L/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/usr/lib -L/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/uikitformac -filelist /Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Intermediates.noindex/Marzipan.build/Debug-uikitformac/CrossTwo.build/Objects-normal/x86_64/CrossTwo.LinkFileList -o /Users/xxxxxx/Library/Developer/Xcode/DerivedData/Marzipan-gbnckgdrmlikahasegoldvxdkpif/Build/Products/Debug-uikitformac/libCrossTwo.a

from openssl.

krzyzanowskim avatar krzyzanowskim commented on May 23, 2024

If you have anything working, I'm happy to see it. Starting with PR would be great to collaborate I think.

from openssl.

chrisvanbuskirk avatar chrisvanbuskirk commented on May 23, 2024

Linking a stackoverflow question I created already. Hopefully it will steer some traffic.

https://stackoverflow.com/questions/56459036/how-does-one-build-a-openssl-library-for-uikitformac

from openssl.

hellc avatar hellc commented on May 23, 2024

Any progress update?
Could we provide static libcrypto lib for UIKit on mac?

from openssl.

krzyzanowskim avatar krzyzanowskim commented on May 23, 2024

I guess we need a script to build a xcframework structure. I didn't dig it much yet by myself.

from openssl.

hellc avatar hellc commented on May 23, 2024

@chrisballinger Could you provide a proper sh script to build libcrypto.a from public source?
It should be compatible with UIKit for mac. Seems like export CFLAGS="-target x86_64-apple-ios-macabi -miphoneos-version-min=13.0" is not enough and I'm having trouble to use resulted static lib in UIKitForMac env. Then I could help u with Universal xcframework script.

from openssl.

chrisballinger avatar chrisballinger commented on May 23, 2024

@hellc Here's a hacky WIP where OpenSSL is compiled in another context: https://github.com/ursachec/CPAProxy/compare/marzipan

from openssl.

fishandphil avatar fishandphil commented on May 23, 2024

Has anyone succeeded with this? Our catalyst app is like 99% ready appart from OpenSSL lib which we haven't achieved to build yet. Thanks

from openssl.

krzyzanowskim avatar krzyzanowskim commented on May 23, 2024

I haven't tried it, but I'm interested in working and confirmed solution to include and release

from openssl.

benrosen78 avatar benrosen78 commented on May 23, 2024

Any update on using this OpenSSL cocoapod in Catalyst?

from openssl.

BubblyNetDev avatar BubblyNetDev commented on May 23, 2024

Hello, are there any updates on this?

from openssl.

krzyzanowskim avatar krzyzanowskim commented on May 23, 2024

Catalyst build is here as of 1.1.180 🎊

from openssl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.