Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting a jnilib to Intel



In article <email@hidden>,
 "William C. McCain" <email@hidden> wrote:

> Before posting my questions, I *DID* download, print, and read the 
> "Universal Binary Programming Guidelines".  But it did not answer ANY of 
> my questions!

I'm sorry to hear that.  Please file bug reports on the questions that 
weren't answered so we can improve future revisions.

> For instance, regarding Rosetta and JNI libraries, the "Guidelines" states:
> 
> Rosetta does not run the following:
> ...
> * Bundled Java applications or Java applications with JNI libraries that 
> can¹t be translated
> 
> I took that as a very ambiguous statement.  Obviously, bundled Java 
> applications, in general, WILL run on Mac OS X under Intel, because 
> Apple will port (or has already ported) the JVM and all required, system 
> level native libraries to Intel -- so no translation is required of Java 
> applications, bundled or not, by Rosetta.

The "obviously" above actually isn't quite right.  All bundled Java 
applications include a Mach-O stub that creates a JVM and kicks off the 
application.  For all existing Java apps, that stub is a PowerPC binary.

Thanks to some terrific work on the part of the Java team, this is 
largely transparent to users of the Developer Transition Systems.  Java 
applications with thin Mach-O stubs relaunch themselves with the 
system's universal version of the stub.  But without that work, no 
existing bundled applications would have run at all on Intel because 
Java isn't supported in Rosetta.  (For example, Java applets will not 
run in a web browser running under Rosetta.)

> Of course, that applies to 
> "pure Java" applications, not ones like mine that have their own native 
> libraries.  But the above statement also refers to "Java applications 
> with JNI libraries that can¹t be translated" -- which CLEARLY (to me) 
> says that "some JNI libraries can be translated, and some cannot".  But 
> which ones can and which ones can't?

None can be translated because Java doesn't run translated.  I'll try to 
get the documentation clarified.

> Secondly, the "Universal Binary Programming Guidelines" talks 
> extensively about building an Xcode project to build a universal binary 
> for a Cocoa application.  Nothing at all about Java!  Or JNI libraries!

Java files themselves are architecture-agnostic, so there's no such 
thing as a "universal Java binary".  JNI libraries are the same as any 
other shared libraries.  Because of that, we didn't feel a need to call 
either case out explicitly.  If you'd like to see it in the 
documentation, please file a bug report.

> No mention of the GCC options needed to build a universal binary, either 
> -- the "Guidelines" are all written in terms of setting Xcode variables. 
>   There is no description of what compiler options are actually 
> GENERATED by these variables!  As I stated, I absolutely refuse to use 
> an "IDE".  I run compilers and all other tools from the command-line, as 
> God intended.  IDEs are VILE!

Then I point thee to Psalm (er, page) 19 in the King James version of 
the Universal Binary Programming Guidelines, which describes the -arch 
flags that you need to pass to the compiler to build a universal binary.  
See also the gcc-4.0 man page.

Hope this helps,
Eric

-- 
Eric Albert            email@hidden
Core Technologies
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Converting a jnilib to Intel (From: Eric Albert <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.