Bug 650

Summary: Fails to build under arm hard float on Debian [Wheezy] and Ubuntu [Precise & Raring]
Product: [JogAmp] Jogl Reporter: Sylvestre Ledru <sylvestre>
Component: coreAssignee: Sven Gothel <sgothel>
Severity: normal CC: gouessej, sgothel, xerxes
Priority: P3    
Version: 2   
Hardware: All   
OS: all   
Type: --- SCM Refs:
Workaround: ---
Attachments: actorize the arm detection and manage arm hard flot (armv4 => armv7)
factorize the arm detection and manage arm hard flot (armv4 => armv7)

Description Sylvestre Ledru 2012-12-07 18:50:22 CET
Under armhf, jogl fail to build with the following error message:
       [cc] Starting link
       [cc] gcc -fpic -march=armv5te -marm -mfloat-abi=softfp -nostdlib -Wl,-Bdynamic -static-libgcc -shared -o libnativewindow_x11.so NativewindowCommon.o Xmisc.o X11Lib_JNI.o XineramaHelper.o -lX11 -lXxf86vm -lXrender
       [cc] /usr/bin/ld: error: /usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/libXrender.so uses VFP register arguments, libnativewindow_x11.so does not
       [cc] /usr/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/libXrender.so
       [cc] collect2: ld returned 1 exit status

Full log is available here:
Comment 1 Julien Gouesse 2013-03-27 14:15:26 CET
Sylvestre, is it still reproducible?
Comment 2 Sylvestre Ledru 2013-03-27 23:22:44 CET
We fixed it in Debian. I will send you the patch asap.
Comment 3 Sylvestre Ledru 2013-03-28 14:53:45 CET
Created attachment 444 [details]
actorize the arm detection and manage arm hard flot (armv4  => armv7)
Comment 4 Sylvestre Ledru 2013-03-28 14:54:03 CET
You will find the patch attached
Comment 5 Julien Gouesse 2013-03-28 16:36:02 CET
(In reply to comment #4)
> You will find the patch attached

Thank you very much. The condition should be moved into another file in order to reduce code duplication.
Comment 6 Sylvestre Ledru 2013-03-28 16:44:49 CET
which condition ? :)
Comment 7 Julien Gouesse 2013-03-28 17:26:55 CET
(In reply to comment #6)
> which condition ? :)

Comment 8 Sylvestre Ledru 2013-03-28 17:33:10 CET
Created attachment 445 [details]
factorize the arm detection and manage arm hard flot (armv4 => armv7)

My bad
Comment 9 Sven Gothel 2013-03-28 18:35:23 CET
(In reply to comment #8)
> Created attachment 445 [details]
> factorize the arm detection and manage arm hard flot (armv4 => armv7)
> My bad

This patch would break our crosscompilation,
due to removal of the cross-config setup.

The isLinuxARM should belong in gluegen-cpptasks-base.xml.

All you actually do is removing gluegen's cc/ld config 'compiler.cfg.linux.armv6', etc.

Hence it would be better allow an alternative cc/ld config suitable for debian (e.g. wheezy setup).
Since I do have wheezy here usually, I will test this.
Comment 10 Sven Gothel 2013-04-23 23:02:12 CEST
Use toolchain default arch & float options for default arm cc/ld target in make/gluegen-cpptasks-base.xml
    Specialized arch & float arm options are defined in
        - lib/gluegen-cpptasks-linux-armv6.xml   (armv5te + softfp), or
        - lib/gluegen-cpptasks-linux-armv6hf.xml (armv6   + hardfp)

TODO: Walk through joal, jogl and jocl ..
Comment 11 Sven Gothel 2013-04-24 02:12:36 CEST
Your case is a build==host, i.e. non crosscompilation environment.

We have to properties:
   -   isAbiEabiGnuArmel (implicit if isAndroidARMv6 or isLinuxARMv6)
   -   isAbiEabiGnuArmhf (shall be declared explicit)

Since we cannot detect at build time (actually we could utilizing our elf reader or 'readelf', 
but do-not right now), the property 'isAbiEabiGnuArmhf' should be defined
if you are building on hard-float!

This is required to set property 'isLinuxARMv6Armhf' or 'isLinuxARMv6Armel' 
which in turn determines the property 'os.and.arch'.

'os.and.arch' will define the native JAR file names, which format is coded 
in our build system and runtime to pick up the proper native jar files.

@Sylvestre: So you have to set ant property 'isAbiEabiGnuArmhf' in your build.

Pls simply ignore the fact that we use '*arm6*' names, it shall not matter.
We currently map all the following to is*ARMv6:
  <os arch="arm" />
  <os arch="armv6" />
  <os arch="armv7" />

If more 'arm' property mappings are indeed required due to different
'os arch' reportings .. we can map them as well.
The latter must be also done in our java code to work properly.
Comment 12 Sven Gothel 2013-04-24 09:56:45 CEST
done, latest builds went through - modules manually validated.