Coder Social home page Coder Social logo

Comments (10)

vgorloff avatar vgorloff commented on June 2, 2024 1

Interesting. Thank you for the figuring out this issue!

The whole idea of NDK symbolic link – is to have "similar path on user side" in "umbrella header" when setting up glibc.modulemap (e.g. /.../swift-android-toolchain/usr/lib/swift/android/armv7/glibc.modulemap). But of cause symbolic link not really needed during build time.

I will try to use your @michaelknoch commit to make two separate variables for NDK path: one will be used during build time (non symlinked) and another will be used when packing toolchain for distribution.

from swift-everywhere-toolchain.

vgorloff avatar vgorloff commented on June 2, 2024

Seems you got this case:

One can engage clang by adjusting PATH to cover same NDK's clang. Just keep in mind that if you miss it, Configure will try to use gcc...

Source: https://github.com/openssl/openssl/blob/master/NOTES-Android.md

That is seems why Configure trying to use arm-linux-androideabi-gcc.


Try to comment or remove line -D__ANDROID_API__=${ndk.api} in file lib/Builders/SSLBuilder.js. Maybe it will help.

Before:

  executeConfigure() {
    this.clean();

    var ndk = new NDK();
    // Seems `-D__ANDROID_API__` not needed. See: #{@sources}/NOTES.ANDROID
    var cmd = `
    ${this.options}
    ./Configure
    // -D__ANDROID_API__=${ndk.api} <<<<<<<<<<<<< THIS LINE IS NOW COMMENTED.
    --prefix=${this.paths.installs}
    `;
    if (this.arch.name == Archs.arm.name) {
      cmd = `${cmd} android-arm`;
    } else if (this.arch.name == Archs.arm64.name) {
      cmd = `${cmd} android-arm64`;
    } else if (this.arch.name == Archs.x86.name) {
      cmd = `${cmd} android-x86`;
    } else if (this.arch.name == Archs.x86_64.name) {
      cmd = `${cmd} android-x86_64`;
    }
    this.executeCommands(`cd ${this.paths.sources} && ${cmd}`);
  }

Then execute: node main.js ssl:make arch:armv7a

from swift-everywhere-toolchain.

vgorloff avatar vgorloff commented on June 2, 2024

btw. Similar issue: openssl/openssl#11192

Maybe you have environment variable "CC" set somewhere?

from swift-everywhere-toolchain.

vgorloff avatar vgorloff commented on June 2, 2024

btw: Another similar issue: openssl/openssl#8941

from swift-everywhere-toolchain.

kangwang1988 avatar kangwang1988 commented on June 2, 2024

Unfortunately, neither of it works.

from swift-everywhere-toolchain.

vgorloff avatar vgorloff commented on June 2, 2024

OK. What command perl configdata.pm --dump returns?

cd ToolChain/Sources/ssl/
perl configdata.pm --dump

from swift-everywhere-toolchain.

kangwang1988 avatar kangwang1988 commented on June 2, 2024

OK. What command perl configdata.pm --dump returns?

cd ToolChain/Sources/ssl/
perl configdata.pm --dump

kylewong@KyleWongs-MacBook-Pro ssl % perl configdata.pm --dump
Can't open perl script "configdata.pm": No such file or directory
kylewong@KyleWongs-MacBook-Pro ssl % pwd
/Users/kylewong/Codes/Swift/swift-everywhere-toolchain/ToolChain/Sources/ssl

from swift-everywhere-toolchain.

vgorloff avatar vgorloff commented on June 2, 2024

Hm. The file configdata.pm even was not generated. Super strange.

Well. If the commands below not working, then it is an issue of SSL. Seems would be more effective to ask them as well: https://github.com/openssl/openssl/issues.

cd ToolChain/Sources/ssl
git clean --quiet -f -X
git clean --quiet -f -x -d
export ANDROID_NDK_HOME=/usr/local/ndk/21.3.6528147
export ANDROID_NDK_ROOT=/usr/local/ndk/21.3.6528147
PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/darwin-x86_64/bin:$ANDROID_NDK_ROOT/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin:$PATH
./Configure android-arm64 -D__ANDROID_API__=29
make SHLIB_VERSION_NUMBER= SHLIB_EXT=.so

Build commands taken from: https://github.com/openssl/openssl/blob/master/NOTES-Android.md

from swift-everywhere-toolchain.

michaelknoch avatar michaelknoch commented on June 2, 2024

I ran into the same issue locally and I found out that it only happens when /usr/local/ndk/21.3.6528147 is a symlink. Not sure why, as far as I know it should be possible to add symlinks to $PATH but in that case it doesn't work.

PATH=/usr/local/ndk/21.3.6528147/toolchains/llvm/prebuilt/darwin-x86_64/bin:$PATH
   ./Configure android-arm -D__ANDROID_API__=21

# Failure!  build file wasn't produced.
# Please read INSTALL and associated NOTES files.  You may also have to look over
# your available compiler tool chain or change your configuration.

# no NDK arm-linux-androideabi-gcc on $PATH at (eval 10) line 124.
# configures successfully

PATH=/Users/username/Library/Android/sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/darwin-x86_64/bin:$PATH \
   ./Configure -D__ANDROID_API__=21 android-arm

I used this commit to workaround it locally. I can open a pr if this makes sense for you as well.

@vgorloff

from swift-everywhere-toolchain.

vgorloff avatar vgorloff commented on June 2, 2024

Maybe the issue is solved in release https://github.com/vgorloff/swift-everywhere-toolchain/releases/tag/1.0.68. In this release the non-symlinked (absolute paths) to NDK tools were used.

from swift-everywhere-toolchain.

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.