Skip to content

[question] libm prevents libunwind.a for arm from being linked? #981

@tomty89

Description

@tomty89

So we have been observing weird issue(s) on arm that is apparently libunwind.a related when building program(s), e.g. gmic, with NDK r19b.

After some tests I found that seemingly libunwind.a is omitted / ignored during linking, if -lunwind is placed after -lm (which is the current default behaviour, as -lunwind is now linked via the "fake" libgcc.a linker script, while -lm is pulled in by "CXX" and hence placed right after -lc++ and before -lgcc).

On the other hand, I realized that the current libc++_shared.so does not have linkage to libm.so anymore (while my /system/lib/libc++.so does, if that's relevant).

So is this a bug of the libunwind.a? Or maybe the NDK toolchain? Or have we been doing something wrong?

Also, is the -lm still necessary with current libc++_shared.so?

Ref.: https://github.com/llvm-mirror/clang/blob/release_80/lib/Driver/ToolChains/Gnu.cpp#L475-L487

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions