Skip to content

x265 doesn't compile because Illumos "ld"ย #455

Closed

Description

@jcea

Smart OS 2016Q4 here, 64bits.

It is using GCC 4.9.4 (automatically, I didn't choose it).

Doing bmake in multimedia/x265 I get this error:

[ 85%] Built target x265-static
Scanning dependencies of target x265-shared
[ 86%] Linking CXX shared library libx265.so
ld: fatal: option -z has illegal argument 'noexecstack'
ld: fatal: flags processing errors
collect2: error: ld returned 1 exit status


[root@PkgSrc /data/pkgsrc/multimedia/x265]# ld --version
ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1754 (illumos)

I guess this is a general problem for any other package using that flag.

After editing the code to delete that option, I get another one:

[100%] Linking CXX executable x265
ld: fatal: -Bsymbolic option is incompatible with building a dynamic executable
ld: fatal: flags processing errors
collect2: error: ld returned 1 exit status
*** Error code 1

Eliminating that I get another error:

[...]
x265_interp8_hps_shuf               0x1454a3    common/CMakeFiles/common.dir/x86/ipfilter8.asm.o
x265_interp8_hps_shuf               0x14579f    common/CMakeFiles/common.dir/x86/ipfilter8.asm.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: error: ld returned 1 exit status

Here I just dropped the ball and post this issue :).

Activity

  1. richlowe commented on Jan 21, 2017

    @richlowe

    relocations against read-only sections tends to be an indication of non-PIC code -- especially where that code is assembler, as I presume that is given the file name. Ideally, you'd fix the code, but -ztextoff or -ztextwarn should allow you to proceed.

    The complaint about -Bsymbolic seems legitimate to me. What are you hoping it will do for you?

  2. jcea commented on Jan 22, 2017

    @jcea
    Author

    I am just doing a bmake to compile multimedia/x265 pkgsrc package, and my expectation is that it compile correctly and cleanly. Currently SmartOS pkg doesn't distribute the binary, but pkgsrc contains the source ready to be compiled. Most of the time this is because licensing, patents, etc. Check the situation, for instance, with "mplayer".

    The usual approach is for the user to compile the code personally, but in this case (x265) it doesn't work.

    My expectation is to bmake to success.

  3. mamash commented on Jan 22, 2017

    @mamash

    There are likely silly expectations about the build toolchain in the x265 Makefiles , e.g. GNU linker is assumed.

  4. mamash commented on Jan 22, 2017

    @mamash

    The workaround is to kill the source/CMakeLists.txt line that adds "-Wl,-Bsymbolic,-znoexecstack" to make things work for the Illumos linker, and add -DENABLE_ASSEMBLY=OFF to CMAKE_ARGS to avoid the relocations problem.

  5. richlowe commented on Jan 22, 2017

    @richlowe

    Presuming the hand-rolled assembler is actually beneficial, I'd recommend -ztextoff rather than disabling its use.

  6. mamash commented on Feb 13, 2017

    @mamash

    Fix from the linked PR committed to pkgsrc trunk.

  7. added a commit that references this issue on Feb 13, 2017
    b4c3d2b
  8. added a commit that references this issue on Mar 20, 2017
  9. added a commit that references this issue on Apr 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions