From andrewbachmann at gmail.com Wed Jul 13 07:53:47 2011 From: andrewbachmann at gmail.com (Andrew Bachmann) Date: Wed, 13 Jul 2011 07:53:47 -0700 Subject: Retrotranslator for running Java 5 on earlier VMs Message-ID: Hello all, I recently saw reference to this tool which can be used to run Java 5 on earlier VMs. This would have been really useful earlier to the Haiku port and might still be useful. I'm passing it along for other porters who may not have a Java 5+ VM: http://retrotranslator.sourceforge.net/ Andrew From spoole at linux.vnet.ibm.com Mon Jul 18 16:00:40 2011 From: spoole at linux.vnet.ibm.com (Steve Poole) Date: Tue, 19 Jul 2011 00:00:40 +0100 Subject: Improving OpenJDK portability - platform specific C conditionals Message-ID: <4E24BB18.2010105@linux.vnet.ibm.com> Hi all, I want to start a discussion about the "right" way to deal with a particular aspect of C code portability - namely platform specific conditionals. In porting to AIX we've frequently had to deal with extending lines like: *#ifdef LINUX * to become *#if defined(LINUX) || defined(AIX) * But that seems wrong - it doesn't aid OpenJDK portability except for one specific new platform. It seems to me a better choice is not to extend the ifdefs as above but to move towards a capability based definition process. So have something like *#ifdef HAS_SPECIFIC_FUNCTION* and then somewhere else have a build file the turns on *HAS_SPECIFIC_FUNCTION *if building on AIX or Linux. Ultimately of course this path takes you down to supporting a ./configure process... I assume this topic has come up before - what's the perceived wisdom for dealing with this problem? Cheers, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/porters-dev/attachments/20110719/620bd7d4/attachment.html From kelly.ohair at oracle.com Mon Jul 18 16:20:17 2011 From: kelly.ohair at oracle.com (Kelly O'Hair) Date: Mon, 18 Jul 2011 16:20:17 -0700 Subject: Improving OpenJDK portability - platform specific C conditionals In-Reply-To: <4E24BB18.2010105@linux.vnet.ibm.com> References: <4E24BB18.2010105@linux.vnet.ibm.com> Message-ID: <836D6868-4A68-4AAF-B670-5A1D799F4DC7@oracle.com> On Jul 18, 2011, at 4:00 PM, Steve Poole wrote: > > > Hi all, > > I want to start a discussion about the "right" way to deal with a particular aspect of C code portability - namely platform specific conditionals. > > In porting to AIX we've frequently had to deal with extending lines like: > > #ifdef LINUX > > to become > > #if defined(LINUX) || defined(AIX) > > > But that seems wrong - it doesn't aid OpenJDK portability except for one specific new platform. It seems to me a better choice is not to extend the ifdefs as above but to move towards a capability based definition process. > > So have something like #ifdef HAS_SPECIFIC_FUNCTION and then somewhere else have a build file the turns on HAS_SPECIFIC_FUNCTION if building on AIX or Linux. I always try and steer people this way, but it is hard to police the entire code base. > > Ultimately of course this path takes you down to supporting a ./configure process... Or having some key setup.h file where these are defined, or defining it in the makefiles. :^( We are heading toward a ./configure process in jdk8, just no specifics yet. -kto > > > I assume this topic has come up before - what's the perceived wisdom for dealing with this problem? > > > > Cheers, > > Steve > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/porters-dev/attachments/20110718/bd5395d2/attachment.html From spoole at linux.vnet.ibm.com Mon Jul 18 23:05:47 2011 From: spoole at linux.vnet.ibm.com (Steve Poole) Date: Tue, 19 Jul 2011 07:05:47 +0100 Subject: Improving OpenJDK portability - platform specific C conditionals In-Reply-To: <836D6868-4A68-4AAF-B670-5A1D799F4DC7@oracle.com> References: <4E24BB18.2010105@linux.vnet.ibm.com> <836D6868-4A68-4AAF-B670-5A1D799F4DC7@oracle.com> Message-ID: <4E251EBB.8080901@linux.vnet.ibm.com> On 19/07/11 00:20, Kelly O'Hair wrote: > > On Jul 18, 2011, at 4:00 PM, Steve Poole wrote: > >> >> >> Hi all, >> >> I want to start a discussion about the "right" way to deal with a >> particular aspect of C code portability - namely platform specific >> conditionals. >> >> In porting to AIX we've frequently had to deal with extending >> lines like: >> >> *#ifdef LINUX * >> >> to become >> >> *#if defined(LINUX) || defined(AIX) >> * >> >> But that seems wrong - it doesn't aid OpenJDK portability except for >> one specific new platform. It seems to me a better choice is not >> to extend the ifdefs as above but to move towards a capability >> based definition process. >> >> So have something like *#ifdef HAS_SPECIFIC_FUNCTION* and then >> somewhere else have a build file the turns on *HAS_SPECIFIC_FUNCTION >> *if building on AIX or Linux. > > I always try and steer people this way, but it is hard to police the > entire code base. > >> >> Ultimately of course this path takes you down to supporting a >> ./configure process... > > Or having some key setup.h file where these are defined, or defining > it in the makefiles. :^( > > We are heading toward a ./configure process in jdk8, just no specifics > yet. That's good news - this is important to me to get sorted out. When you say "heading towards" does that mean there is a discussion thread somewhere in OpenJDK where this is being discussed? (There are so many mailing lists :-) ) > > -kto > >> >> >> I assume this topic has come up before - what's the perceived wisdom >> for dealing with this problem? >> >> >> >> Cheers, >> >> Steve >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/porters-dev/attachments/20110719/ef59c996/attachment.html From kelly.ohair at oracle.com Tue Jul 19 07:56:20 2011 From: kelly.ohair at oracle.com (Kelly O'Hair) Date: Tue, 19 Jul 2011 07:56:20 -0700 Subject: Improving OpenJDK portability - platform specific C conditionals In-Reply-To: <4E251EBB.8080901@linux.vnet.ibm.com> References: <4E24BB18.2010105@linux.vnet.ibm.com> <836D6868-4A68-4AAF-B670-5A1D799F4DC7@oracle.com> <4E251EBB.8080901@linux.vnet.ibm.com> Message-ID: <3D52911D-F954-41A2-8EE7-E2B598636F94@oracle.com> On Jul 18, 2011, at 11:05 PM, Steve Poole wrote: >> >> We are heading toward a ./configure process in jdk8, just no specifics yet. > > That's good news - this is important to me to get sorted out. When you say "heading towards" does that mean > there is a discussion thread somewhere in OpenJDK where this is being discussed? (There are so many mailing lists :-) ) > We are investigating possibly using autoconf, but it's not clear it will work for us in all situations and platforms. The JDK is not your typical open source project, and sometimes the common open source tools just don't work well. But the basic ./configure concept is what we want. It's more of an investigation, and not really a discussion. If and when the discussion happens, it will be on the build-infra mailing list. -kto From revol at free.fr Tue Jul 19 08:08:23 2011 From: revol at free.fr (=?ISO-8859-1?Q?Fran=E7ois?= Revol) Date: Tue, 19 Jul 2011 17:08:23 +0200 Subject: Improving OpenJDK portability - platform specific C conditionals In-Reply-To: <4E251EBB.8080901@linux.vnet.ibm.com> References: <4E24BB18.2010105@linux.vnet.ibm.com> <836D6868-4A68-4AAF-B670-5A1D799F4DC7@oracle.com> <4E251EBB.8080901@linux.vnet.ibm.com> Message-ID: <1311088103.3035.5.camel@laptop> Hi, Le mardi 19 juillet 2011 ? 07:05 +0100, Steve Poole a ?crit : > > > But that seems wrong - it doesn't aid OpenJDK portability except > > > for one specific new platform. It seems to me a better choice is > > > not to extend the ifdefs as above but to move towards a > > > capability based definition process. > > > > > > So have something like #ifdef HAS_SPECIFIC_FUNCTION and then > > > somewhere else have a build file the turns on > > > HAS_SPECIFIC_FUNCTION if building on AIX or Linux. > > I always try and steer people this way, but it is hard to police the > > entire code base. +1, also because sometimes OS evolve and start supporting new stuff. At least this happens with Haiku for ex (we're getting RT signals). So having a central place to update things makes sense. > > We are heading toward a ./configure process in jdk8, just no > > specifics yet. > > That's good news - this is important to me to get sorted out. As for autodetection, this usually doesn't work very well with cross-compiling, but I guess we'll see. Fran?ois. From volker.simonis at gmail.com Tue Jul 19 08:51:11 2011 From: volker.simonis at gmail.com (Volker Simonis) Date: Tue, 19 Jul 2011 17:51:11 +0200 Subject: Improving OpenJDK portability - platform specific C conditionals In-Reply-To: <3D52911D-F954-41A2-8EE7-E2B598636F94@oracle.com> References: <4E24BB18.2010105@linux.vnet.ibm.com> <836D6868-4A68-4AAF-B670-5A1D799F4DC7@oracle.com> <4E251EBB.8080901@linux.vnet.ibm.com> <3D52911D-F954-41A2-8EE7-E2B598636F94@oracle.com> Message-ID: On Tue, Jul 19, 2011 at 4:56 PM, Kelly O'Hair wrote: > > On Jul 18, 2011, at 11:05 PM, Steve Poole wrote: > >>> >>> We are heading toward a ./configure process in jdk8, just no specifics yet. >> >> That's good news - ?this is important to me to get sorted out. ? When you say "heading towards" does that mean >> there is a discussion thread somewhere in OpenJDK where this is being discussed? ? (There are so many mailing lists :-) ) >> > > We are investigating possibly using autoconf, but it's not clear it will work for us in all situations > and platforms. The JDK is not your typical open source project, and sometimes the common open > source tools just don't work well. That's true, unfortunately. Please don't forget the Windows build, and the cross build for Windows/Itanium. I know that not may people care about it, but some still have to do it (unfortunately:) > But the basic ./configure concept is what we want. > It's more of an investigation, and not really a discussion. > > If and when the discussion happens, it will be on the build-infra mailing list. > > -kto From spoole at linux.vnet.ibm.com Thu Jul 21 12:19:08 2011 From: spoole at linux.vnet.ibm.com (Steve Poole) Date: Thu, 21 Jul 2011 20:19:08 +0100 Subject: Improving OpenJDK portability - platform specific C conditionals In-Reply-To: <1311088103.3035.5.camel@laptop> References: <4E24BB18.2010105@linux.vnet.ibm.com> <836D6868-4A68-4AAF-B670-5A1D799F4DC7@oracle.com> <4E251EBB.8080901@linux.vnet.ibm.com> <1311088103.3035.5.camel@laptop> Message-ID: <4E287BAC.7030800@linux.vnet.ibm.com> On 19/07/11 16:08, Fran?ois Revol wrote: > Hi, > > Le mardi 19 juillet 2011 ? 07:05 +0100, Steve Poole a ?crit : > >>>> But that seems wrong - it doesn't aid OpenJDK portability except >>>> for one specific new platform. It seems to me a better choice is >>>> not to extend the ifdefs as above but to move towards a >>>> capability based definition process. >>>> >>>> So have something like #ifdef HAS_SPECIFIC_FUNCTION and then >>>> somewhere else have a build file the turns on >>>> HAS_SPECIFIC_FUNCTION if building on AIX or Linux. >>> I always try and steer people this way, but it is hard to police the >>> entire code base. > +1, also because sometimes OS evolve and start supporting new stuff. > At least this happens with Haiku for ex (we're getting RT signals). > So having a central place to update things makes sense. > > >>> We are heading toward a ./configure process in jdk8, just no >>> specifics yet. >> That's good news - this is important to me to get sorted out. > As for autodetection, this usually doesn't work very well with > cross-compiling, but I guess we'll see. > Ah - forgotten about xcompiling - that's obviously stage 2 :-) To all, I'd like offer up some changes as described previously. I'd have to find a place to turn the definitions on per platform, the obvious place is in the jdk/make/common/Defs-*.gmk platform files. Is that reasonable ? I don't believe there are going to be that many instances but I'll do a trawl and provide a list. Probably in week or so though > Fran?ois. > > >