[oe] openjdk-7 and gcc v5

Khem Raj raj.khem at gmail.com
Tue Nov 3 19:32:02 UTC 2015


> On Nov 3, 2015, at 10:18 AM, Bruce, Henry <henry.bruce at intel.com> wrote:
> 
> On Thu, 2015-10-29 at 17:43 -0700, Khem Raj wrote:
>> On Thu, Oct 29, 2015 at 4:00 PM, Bruce, Henry <henry.bruce at intel.com>
>> wrote:
>>> Many thanks to contributors who fixed openjdk build issues
>>> introduced by gcc v5 and for maintainers for pushing the updates.
>>> However one problem remains: openjdk build fails in
>>> openjdk/jdk/make/java/nio due to -static compiler flag being used
>>> in conjunction with -pthread giving error
>>> /usr/bin/ld: cannot find -lpthread
>>> /usr/bin/ld: cannot find -lc
>>> 
>> 
>> its not clear how the -static flag can cause this. may be its using
>> CC for LD or wise versa ?
> 
> Not clear to me either, but if you create a simple file, say test.c
> 
> int main()
> {
>  return 0;
> }
> 
> and compile with gcc test.c -pthread -static
> it fails as follows with gcc v5
> /usr/bin/ld: cannot find -lpthread
> /usr/bin/ld: cannot find -lc
> 
> but compiles OK with earlier versions of gcc.

isn’t this gcc on your build host ?


> 
>> 
>>> I fixed this by removing -static flag from Makefile. Not sure of
>>> this was the right thing to do (so I didn't submit patch) but it
>>> worked for me.
>>> I added the following to the an openjdk bbappend and it fixed the
>>> build and resulting jre is running OK.
>>> 
>>> do_configure_append() {
>>>        gcc -v 2>&1 | grep 5\..
>>>        if [ "$?" == "0" ]; then
>> 
>> why this check for gcc ?
> 
> It only fails with gcc v5, so if it's not broken, don't fix it...
> 
>> 
>>>                sed -i s/-static//
>>> ${B}/openjdk/jdk/make/java/nio/Makefile
>>>        fi
>>> }
>>> 
>>> Regards,
>>> 
>>> Henry Bruce
>>> 
>>> --
>>> _______________________________________________
>>> Openembedded-devel mailing list
>>> Openembedded-devel at lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openembedded.org/pipermail/openembedded-devel/attachments/20151103/01cb259e/attachment-0002.sig>


More information about the Openembedded-devel mailing list