Menu

#230 Fix compilation on AArch64

libpng_code
closed-fixed
aarch64 (1)
5
2014-11-20
2014-11-03
No

When libpng 1.6.14 is built on AArch64 (64-bit ARMv8) architecture the ARM NEON support is partially enabled. This is because ARM_NEON/__ARM_NEON macro is defined for this architecture as well as for 32-bit ARM.

Generated Makefile does not include arm/ directory so ARM NEON code is not built which ends with linking error:

./.libs/libpng16.so: undefined reference to `png_init_filter_functions_neon'
collect2: error: ld returned 1 exit status

Attached patch exports PNG_ARM_NEON macro used my automake to be available at C preprocessor level so if ARM NEON code is not going to be compiled then support for it is also disabled in C code.

1 Attachments

Discussion

  • Glenn Randers-Pehrson

    • assigned_to: Glenn Randers-Pehrson
     
  • Glenn Randers-Pehrson

    PNG_ARM_NEON seems to conflict with the existing macro defined in png.h and used in arm/arm_init.c as a pointer into png_ptr->options. I think we should create a new macro such as PNG_USE_ARM_NEON here.

     
  • Glenn Randers-Pehrson

    Please try libpng-1.6.15beta03 (head of the libpng16 branch of the libpng GIT repository at SourceForge or the glennrp/libpng GIT repository at github).

     
  • Marcin Juszkiewicz

    commit 32784523239c376dfe544bb6c7012c4934624a6d
    Author: Glenn Randers-Pehrson <glennrp at="" users.sourceforge.net="">
    Date: Mon Nov 3 08:24:34 2014 -0600</glennrp>

    [libpng16] Added PNG_USE_ARM_NEON configuration flag (Marcin Juszkiewicz).
    

    Builds fine and passes testsuite.

     
  • Glenn Randers-Pehrson

    • status: open --> open-accepted
     
  • Glenn Randers-Pehrson

    There's a suggestion on the png-mng-implement list to do this instead:
    Just change line 309 of configure.ac:

    -      arm*) :;;
    +     arm*|aarch64*) :;;
    

    The effect is not to turn off ARM optimization but to ensure that the libpng/arm directory is present.

    This should have less of an effect on other ARM/NEON builds. With the original patch, other builds would have to start defining PNG_USE_ARM_NEON.

    Please try libpng-1.6.15beta04 from the glennrp/libpng repository at github, libpng16 branch.

     
  • Marcin Juszkiewicz

    commit 445475a1660a590111c73a8724c644649df4aebd
    Author: John Bowler jbowler@acm.org
    Date: Mon Nov 3 19:44:39 2014 -0600

    [libpng16] Removed new PNG_USE_ARM_NEON configuration flag and made a one-line
    
    revision to configure.ac to support ARM on aarch64 instead (John Bowler).
    

    Works fine as well.

     
  • Glenn Randers-Pehrson

    Fixed in libpng-1.6.15

     
  • Glenn Randers-Pehrson

    • status: open-accepted --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB