On Nov 28, 2007 10:47 AM, Kelly O'Hair <<a href="mailto:Kelly.Ohair@sun.com">Kelly.Ohair@sun.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 From earlier emails... it appears you are trying to build 32bit on a 64bit machine?</blockquote><div><br>Yes, we are doing cross builds on 64-bit machines for 32-bit binaries.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>In general we don't do that, or haven't.<br>For us, Linux 32bit builds are done on 32bit machines, 64bit on 64bit machines.<br>Mostly because our official build systems are completely different Linux's for 32 and 64.
<br><br>If your adventure is to figure out how to build 32bit on a 64bit system, please keep track<br>of what you had to do and we can document it, and have fun. ;^)<br></blockquote><div><br>After enumerating in86, I think I have found the  magic  ARCH value for cross builds - i586. It is accepted by corba and jli and other modules with minimal patches. I am currently verifying the minimal number of changes to make it work.
<br><br>Thanks,<br>-Ben<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Other than makefile changes... (the ARCH sistuation is tricky)...
<br>I know that you need some 32bit static libraries installed on your 64bit<br>system (ones that are not installed by default).<br><br>-kto<br><div><div></div><div class="Wj3C7c"><br>Kelly O'Hair wrote:<br>> I recall a problem where if you have an env variable named ARCH, you
<br>> will impact the build of hotspot. I forget all the details, but I recall<br>> that some of the hotspot makefiles do an 'ifndef ARCH' before setting ARCH,<br>> so it can get impacted by the environment variables.
<br>><br>> The ARCH_DATA_MODEL=32 or ARCH_DATA_MODEL=64 is used by the openjdk<br>> makefiles<br>> (hotspot makefiles may also look for LP64=1).<br>> I would try running 'make sanity' and see what ARCH setting it has.
<br>><br>> The whole arch naming issue is a bit messy. There is a libarch name used<br>> under<br>> the 'lib' directory, I call this LIBARCH and for Solaris and Linux it's<br>> one of<br>> i386, sparc, amd64, or sparcv9. (Linux may use sparc64???)
<br>> Windows doesn't really use a LIBARCH.<br>><br>> Then there is the ARCH used after the PLATFORM name of windows, linux,<br>> solaris<br>> to create the directory names and bundles, like windows-i586 (yes, it's
<br>> i586<br>> in this case, or sparc or amd64 or sparcv9).<br>> Then there are other places where people have used generic arch names like<br>> x86 or x64.<br>><br>> My advice is to not mess with ARCH and not set ARCH in your environment.
<br>> If the makefiles aren't figuring out what the correct ARCH is, then we<br>> should<br>> fix that. I'm not sure when this ARCH mess will ever be cleaned up, but<br>> the first step may be to stop using the spelling "ARCH" in the makefiles
<br>> because of the confusion as to where it's used and what it means.<br>> (Getting ARCH from the environment variables also seems very wrong to me)<br>><br>> ---<br>> The ALT_JDK_IMPORT_PATH problem is a known one, setting it to the boot
<br>> jdk is<br>> harmless when doing a full build.<br>><br>> -kto<br>><br>> Ben Cheng wrote:<br>>> Hi Folks,<br>>><br>>> I am trying to build 32-bit openjdk7 from source under control/make,
<br>>> but I seem to have endless troubles picking up the right ARCH option.<br>>> The source code is from the b23 snapshot.<br>>><br>>> I started with<br>>><br>>> make ARCH_DATA_MODEL=32 ALT_BOOTDIR=/usr/lib/jvm/java-6-sun
<br>>> ANT_HOME=<my_ant_path> FINDBUGS_HOME=<my_findbugs_path><br>>><br>>> It quickly failed with the following error:<br>>><br>>> [ gcc command neglected]<br>>> ...<br>>> -ljvm  -L/usr/lib/jvm/java-6-sun/jre/lib/amd64 -ljava
<br>>> -L/usr/lib/jvm/java-6-sun/jre/lib/amd64/server -ljvm -lc<br>>> /usr/bin/ld: cannot find -ljvm<br>>><br>>> because there is no amd64 under /usr/lib/jvm/java-6-sun/jre/lib but<br>>> only i386, and without specifying ARCH the makefile relies on "uname
<br>>> -m" to guess the ARCH, and it chooses amd64 when seeing x86_64.<br>>><br>>> So I tried to add ARCH=i386 in the command line. The build goes past<br>>> the previous stage, but sees a different in building corba/make/javax/xa:
<br>>><br>>> /bin/sh: line 5: Check_ALT_JDK_IMPORT_PATH/bin/javac: No such file or<br>>> directory<br>>><br>>> This problem is slightly off topic, as it seems to require adding<br>>> ALT_JDK_IMPORT_PATH to the command-line even my intention is to do a
<br>>> complete build. Although I still don't know why it is necessary,<br>>> adding ALT_JDK_IMPORT_PATH=$ALT_BOOTDIR gets me past corba, but the<br>>> builds stalls at hotspot:<br>>><br>>>
<br>>> make[6]: *** No rule to make target<br>>> `openjdk/v1_7/hotspot/src/cpu/i386/vm/x86_32.ad', needed by<br>>> `../generated/adfiles/linux_x86_32.ad'.  Stop.<br>>><br>>> Apparenly hotspot doesn't like ARCH=i386 but prefers ARCH=x86, and I
<br>>> found a place to hack in hotspot/build/linux/Makefile, where I<br>>> override ARCH=$(SRCARCH) in the following context:<br>>><br>>> $(TARGETS_C2):  $(SUBDIRS_C2)<br>>>         cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
<br>>> ARCH=$(SRCARCH)<br>>><br>>> Then, the next error shows up in exporting jvmti.html, where I need to<br>>> add the following rule in hotspot/build/linux/makefiles<br>>> /defs.make if I define ARCH as i386:
<br>>><br>>> ifeq ($(ARCH), i386)<br>>>   ARCH_DATA_MODEL  = 32<br>>>   PLATFORM         = linux-i586<br>>>   VM_PLATFORM      = linux_i486<br>>>   HS_ARCH          = x86<br>>> endif
<br>>><br>>> There is a similar patch for i586 so I suspect people tried to build<br>>> hotspot with ARCH=i686 and ran into similar errors.<br>>><br>>> Well, this is not the end of errors, as the next one shows up in
<br>>> jdk/make/java/jli, where it fails to locate ergo_i386.c because only<br>>> the following two variants are available:<br>>><br>>> jdk/src/solaris/bin/ergo_i586.c<br>>> jdk/src/solaris/bin/ergo_sparc.c
<br>>><br>>> In summary, my questions can be condensed into two:<br>>><br>>> 1) Is control/make the right place to build everything from source. If<br>>> so, why is ALT_JDK_IMPORT_PATH needed in the make command line?
<br>>> 2) What is the ARCH value applicable to all modules if the goal is to<br>>> build 32-bit package on x86_64 platform?<br>>><br>>> Thanks,<br>>> -Ben<br></div></div></blockquote></div><br>