<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - -fuse-init-array has no effect (-triple x86_64-unknown-freebsd10.3)"
href="https://llvm.org/bugs/show_bug.cgi?id=30494">30494</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-fuse-init-array has no effect (-triple x86_64-unknown-freebsd10.3)
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>emaste@freebsd.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Clang HEAD on FreeBSD 10.3/amd64.
The sample global constructor used here is at
<a href="https://github.com/emaste/snippets/blob/master/global_constructor.cc">https://github.com/emaste/snippets/blob/master/global_constructor.cc</a>
% bin/clang-4.0 -v -c -fuse-init-array global_constructor.cc
...
"/tank/emaste/src/llvm/build-nodebug/bin/clang-4.0" -cc1 -triple
x86_64-unknown-freebsd10.3 -emit-obj -mrelax-all -disable-free -main-file-name
global_constructor.cc -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -v -dwarf-column-info
-debug-info-kind=standalone -dwarf-version=2 -debugger-tuning=gdb
-coverage-notes-file /tank/emaste/src/snippets/global_constructor.gcno
-resource-dir /tank/emaste/src/llvm/build-nodebug/bin/../lib/clang/4.0.0
-internal-isystem /usr/include/c++/v1 -fdeprecated-macro
-fdebug-compilation-dir /tank/emaste/src/snippets -ferror-limit 19
-fmessage-length 149 -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o global_constructor.o -x c++
global_constructor.cc
...
The resulting object file still uses .ctors:
% readelf -S global_constructor.o | egrep -A1 'init|fini|ctor|dtor'
[ 9] .ctors PROGBITS 0000000000000000 000000d8
0000000000000008 0000000000000000 WA 0 0 8
[10] .rela.ctors RELA 0000000000000000 00000370
0000000000000018 0000000000000018 15 9 8</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>