Bug 650 - Fails to build under arm hard float on Debian [Wheezy] and Ubuntu [Precise & Raring]
Summary: Fails to build under arm hard float on Debian [Wheezy] and Ubuntu [Precise & ...
Status: RESOLVED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 2
Hardware: All all
: P3 normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2012-12-07 18:50 CET by Sylvestre Ledru
Modified: 2013-04-24 09:56 CEST (History)
3 users (show)

See Also:
Type: ---
SCM Refs:
9267c581b199060ded0ddfa0258ff6bff4ba2163
Workaround: ---


Attachments
actorize the arm detection and manage arm hard flot (armv4 => armv7) (14.40 KB, patch)
2013-03-28 14:53 CET, Sylvestre Ledru
Details | Diff
factorize the arm detection and manage arm hard flot (armv4 => armv7) (14.40 KB, patch)
2013-03-28 17:33 CET, Sylvestre Ledru
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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:
https://buildd.debian.org/status/fetch.php?pkg=libjogl2-java&arch=armhf&ver=2.0-rc11-1~exp2&stamp=1354295707
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 ? :)

isLinuxARM
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.