Skip to content

LTO build not working #10

@DarjanKrijan

Description

@DarjanKrijan

I tried adding Link Time Optimization by adding '-flto' to CCFLAGS and LINKFLAGS in src/SConscript, it results in compiler warnings and eventually errors:
libalm_gcc_lto_warnings_errors.txt
This is with GCC 11.1.0.

Also AOCC 3.1.0 gives an error not finding LLVMgold.so, while other compiles with -flto work with it:

$ scons -j1 --compiler=aocc
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
 [    CC] fast/_exp_tables.c => src/fast/_exp_tables.o
 [    CC] fast/expf.c => src/fast/expf.o
 [    CC] fast/logf.c => src/fast/logf.o
 [    CC] fast/powf.c => src/fast/powf.o
 [    CC] fast/tan.c => src/fast/tan.o
 [    CC] fast/tanf.c => src/fast/tanf.o
 [    AR] src/fast/libalmfast.a
 [RANLIB] src/fast/libalmfast.a
 [SHLINK] src/fast/libalmfast.so
/usr/bin/ld: /opt/aocc/bin/../lib/LLVMgold.so: error loading plugin: /opt/aocc/bin/../lib/LLVMgold.so: cannot open shared object file: No such file or directory
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [build/aocl-release/src/fast/libalmfast.so] Error 1
scons: building terminated because of errors.
====================== Configuration ======================

        Compiler     : aocc                  Build    : release
        ABI          : aocl                  Developer: 0
        ToolchainDir : /usr/bin
        BuildDir     : build/aocl-release
        
===========================================================

Link Time Optimization would be very benefitial for a library like this for better linking, inlining some functionality.
Is this something that could be fixed and supported?

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