[llvm-bugs] [Bug 26727] New: clang doesn't link __init_array properly

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 24 13:13:12 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26727

            Bug ID: 26727
           Summary: clang doesn't link __init_array properly
           Product: clang
           Version: 3.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jeff.crowell+llvm-list at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

In ngx_pagespeed https://github.com/pagespeed/ngx_pagespeed build instructions,
a static .a library which has an __init_array (prebuilt with gcc and provideed)
in it doesn't link properly.

If nginx is built with gcc, the __init_array gets populated

if nginx is built with clang, the __init_array is empty.

for an example see https://gist.github.com/crowell/9952fa514e8b861e5d66

I've tried using clang 3.4 which came with epel, and the gcc toolchain from
devtoolset, as well as the gcc toolchain from a source built gcc 5.1, and a
source built clang 3.7 with both gcc toolchains.

the gcc compiled code always has the __init_array populated, and the clang
compiled code never does.


to reproduce follow these instructions on centos 6.7

https://developers.google.com/speed/pagespeed/module/build_ngx_pagespeed_from_source

but export CC="clang --gcc-toolchain=/opt/rh/devtoolset-2/root/usr/" or
whatever path points to a c++11 compatible gcc toolchain.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160224/697f4797/attachment.html>


More information about the llvm-bugs mailing list