Coder Social home page Coder Social logo

Comments (14)

x2on avatar x2on commented on July 16, 2024

I have tested it with Xcode 5.1.1 and it works fine on different Macs, so i think something is broken on your system!

Downloading openssl-1.0.1g.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4403k  100 4403k    0     0  3240k      0  0:00:01  0:00:01 --:--:-- 3242k
Building openssl-1.0.1g for iPhoneSimulator 7.1 i386
Please stand by...
Building openssl-1.0.1g for iPhoneSimulator 7.1 x86_64
Please stand by...
Building openssl-1.0.1g for iPhoneOS 7.1 armv7
Please stand by...
Building openssl-1.0.1g for iPhoneOS 7.1 armv7s
Please stand by...
Building openssl-1.0.1g for iPhoneOS 7.1 arm64
Please stand by...
Build library...
Building done.
Cleaning up...
Done.
$> file lib/libssl.a 
lib/libssl.a: Mach-O universal binary with 5 architectures
lib/libssl.a (for architecture i386):   current ar archive random library
lib/libssl.a (for architecture x86_64): current ar archive random library
lib/libssl.a (for architecture armv7):  current ar archive random library
lib/libssl.a (for architecture armv7s): current ar archive random library
lib/libssl.a (for architecture cputype (16777228) cpusubtype (0)):  current ar archive random library

from openssl-for-iphone.

x2on avatar x2on commented on July 16, 2024

You could also have a look at the travis-ci build which works fine:

https://travis-ci.org/x2on/OpenSSL-for-iPhone#L8373

$> xcrun -sdk iphoneos lipo -info ./lib/*.a
Architectures in the fat file: ./lib/libcrypto.a are: i386 x86_64 armv7 armv7s arm64 
Architectures in the fat file: ./lib/libssl.a are: i386 x86_64 armv7 armv7s arm64 

from openssl-for-iphone.

isa56k avatar isa56k commented on July 16, 2024

Hi,

I'm also hitting exactly the same issue.

@arik-so - Did you manage to resolve this? If so any advice on what you did to fix it?

TIA.

from openssl-for-iphone.

rsodre avatar rsodre commented on July 16, 2024

It happened to me when I upgraded to Xcode 5.1.1
I fixed by downloading again the Command Line Tools (Preferences, Downloads)

from openssl-for-iphone.

isa56k avatar isa56k commented on July 16, 2024

Hi @rsodre ,

When I go to Preferences > Downloads I don't see command line tools?

If I try to do xcode-select --install I get the error "Can't install the software because it is not currently available from the software update server". From reading around I think this a bit of a spurious error and is generated when command line tools already exist.

I have downloaded separately and installed from https://developer.apple.com/downloads and installed but still I get the same ranlib error when trying to build for arm64.

Two questions, where does xcode-select -p point to on your machine and is /opt/local/bin/ranlib a sym link to libtool ?

mymac:OpenSSL-for-iPhone isa56k$ ls -lamo /opt/local/bin/ranlib
lrwxr-xr-x 1 root 7 8 Feb 07:06 /opt/local/bin/ranlib -> libtool

TIA

from openssl-for-iphone.

x2on avatar x2on commented on July 16, 2024

On my machine /opt/local/bin/ranlib doesn't exists and the build of OpenSSL works fine.

$ ls -lamo /opt/local/bin/ranlib
ls: /opt/local/bin/ranlib: No such file or directory

from openssl-for-iphone.

isa56k avatar isa56k commented on July 16, 2024

@x2on Oh.. hmm.. what does $ which ranlib give you?

from openssl-for-iphone.

isa56k avatar isa56k commented on July 16, 2024

At last it has built... :)

I think it must be to do with the sym link to libtool.

I just removed it and then did a which on ranlib, this pointed to /usr/bin/ranlib. I tried to build again and it failed with the error below:

ar r ../libcrypto.a cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o mem_clr.o
ar: creating archive ../libcrypto.a
ar: can't find or exec: /opt/local/bin/ranlib (No such file or directory)
ar: internal ranlib command failed

I then cp /usr/bin/ranlib to /opt/local/bin/ranlib and re ran the build script, this time it ahs all built successfully.

Why I had a sym link to libtool from ranlib in the first place don't know, even the freshly downloaded command line tools seemed to have this.

I expect it is something messed up in my config somewhere, exactly where I'm not really sure or why. Anyways, it's compiled now!

Thanks for comments... It's got me going in right direction. :)

from openssl-for-iphone.

x2on avatar x2on commented on July 16, 2024
$ which ranlib
/usr/bin/ranlib

from openssl-for-iphone.

buddydvd avatar buddydvd commented on July 16, 2024

I had the same issue and, after some investigation, I discovered the root cause was due to me having installed MacPorts. Apparently, MacPorts installs a version of ranlib/libtool to /opt/local/bin which conflicts with the build process. I tried (but failed) to workaround this issue by explicitly declaring the path to ranlib by inserting this line into build-libssl.sh:

export RANLIB="`${BUILD_TOOLS}/usr/bin/xcrun --find ranlib`"

since OpenSSL's Configure script carries the RANLIB value to the generated Makefile. Unfortunately, the generated Makefile still chooses the default (implicitly determined) path instead of the explicitly declared path.

So, in summary, the solution is to uninstall MacPorts.

from openssl-for-iphone.

x2on avatar x2on commented on July 16, 2024

Thanks for the investigation - i added a hint to the Readme about MacPorts.

from openssl-for-iphone.

kewinwang avatar kewinwang commented on July 16, 2024

I meet the problem and even I have not install Macport (I use brew mostly) ,any help?

i try to use https://gist.githubusercontent.com/foozmeat/5154962/raw/23029f08d3475a75269e2e05d7388355f745d641/openssl-build.sh
build successfully ,but meet the follow problem :

ld: library not found for -lcrypto
clang: error: linker command failed with exit code 1 (use -v to see invocation)

from openssl-for-iphone.

vixentael avatar vixentael commented on July 16, 2024

Hello from 2015! :)

Thank you @isa56k for your tips. I tried lots of suggestions, but yours worked.

I have the same issue on Yosemite 10.10.5 with Xcode 7.1 and installed Command Line Tools. Cocoapods 0.39.0. No MacPorts.

I found that ranlib was linked to libtool.

~ ls -lamo /opt/local/bin/ranlib          
lrwxr-xr-x  1 root  7 Jan 30  2014 /opt/local/bin/ranlib -> libtool

I removed link and copied ranlib from /usr/bin/ranlib

~ sudo rm /opt/local/bin/ranlib
~ sudo cp /usr/bin/ranlib /opt/local/bin/ranlib
~ ls -lamo /opt/local/bin/ranlib          
-rwxr-xr-x+ 1 root  14160 Oct 27 16:21 /opt/local/bin/ranlib
~ which ranlib
/opt/local/bin/ranlib

Just in case, I read that there could be similar issues with ar. My ar was okay.

~ which ar    
/opt/local/bin/ar
~ ls -lamo /opt/local/bin/ar    
-r-xr-xr-x+ 1 root  32176 Jul  5  2013 /opt/local/bin/ar

from openssl-for-iphone.

raybellis avatar raybellis commented on July 16, 2024

I found it was sufficient just to temporarily remove /opt/local/bin from my path.

from openssl-for-iphone.

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.