<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 10, 2020 at 4:01 PM Eli Friedman via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div class="gmail-m_8536515185539131232WordSection1">
<p class="MsoNormal">That name is terrible; if we’re going to add this, the canonical name should be something like -fignore-visibility-attributes. (We can also accept an alias if you need it.)</p></div></div></blockquote><div>We won't require an alias. The XL compiler option was not "-fnovisibility".<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_8536515185539131232WordSection1"><p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In terms of the functionality, it seems a little weird; cross-platform projects usually use macros for this sort of thing.  And I’m a little worried we’ll eventually need to add an attribute to override the flag, and then we’ll need flag
 to override that attribute, etc.  But if we need it for compatibility with existing AIX compilers, it’s hard to argue with that.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">-Eli<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> cfe-dev <<a href="mailto:cfe-dev-bounces@lists.llvm.org" target="_blank">cfe-dev-bounces@lists.llvm.org</a>> <b>On Behalf Of
</b>digger lin via cfe-dev<br>
<b>Sent:</b> Thursday, September 10, 2020 7:04 AM<br>
<b>To:</b> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<b>Subject:</b> [EXT] [cfe-dev] add new option -fnovisibility for clang<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Hi All,<br>
<br>
  In IBM compiler Xlclang , there is option -fnovisibiilty. The option is description as<br>
  <a href="https://www.ibm.com/support/knowledgecenter/SSGH3R_16.1.0/com.ibm.xlcpp161.aix.doc/compiler_ref/opt_visibility.html" target="_blank">https://www.ibm.com/support/knowledgecenter/SSGH3R_16.1.0/com.ibm.xlcpp161.aix.doc/compiler_ref/opt_visibility.html</a> <br>
 <br>
  we need to add the option -fnovisibiilty for clang in the IBM AIX OS(and the option is enabled by default in AIX OS).  <br>
  I will implement the option in the other OS platform.(but the option is disabled by default in other OS).<br>
 <br>
  For example, the file test.c<br>
 <br>
 bash-4.2$ test.c<br>
 __attribute__((visibility ("protected"))) int b;<br>
 <br>
 1 In AIX OS:<br>
 <br>
 1.1 Compiled with<br>
 <br>
<b>  clang -fnovisibility    -target powerpc-unknown-aix  -emit-llvm  -S test.c</b><br>
 or  <br>
  <b>clang -target powerpc-unknown-aix  -emit-llvm  -S test.c </b> ( the -fnovisibility is <b>enabled</b> by default in AIX OS)<br>
<br>
 Generate IR as :<br>
 <br>
  <b>@b = global i32 0, align 4</b><br>
 <br>
 1.2 Compiled with<br>
  (If have "-fnovisibility  -fvisibility=*" at the same time.  the compile will ignore the -fnovisibility). <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <br>
  <b>clang -fnovisibility  -fvisibility=default   -target powerpc-unknown-aix   -emit-llvm  -S test.c</b><br>
<br>
Or<br>
<br>
  <b>clang -fvisibility=default   -target powerpc-unknown-aix   -emit-llvm  -S test.c</b><br>
 <br>
  Generate IR as :<br>
  <b>@b = protected global i32 0, align 4</b><br>
 <br>
 2. In Other OS(not AIX)<br>
   2.1<b> clang -fnovisibility    -target powerpc-unknown-linux  -emit-llvm  -S test.c</b><br>
   <br>
    Generate IR as :<br>
    <b>@b = global i32 0, align 4</b><br>
<br>
  2.2<br>
   <b> clang -target powerpc-unknown-linux  -emit-llvm  -S test.c</b> ( the -fnovisibility is <b>disabled </b>by default in not AIX OS)<br>
  Or<br>
    (if have "-fnovisibility  -fvisibility=*" at the same time.  the compile will ignore the -fnovisibility).<br>
    <b>clang -fnovisibility  -fvisibility=default   -target powerpc-unknown-linux   -emit-llvm  -S test.c</b><br>
  Or<br>
    <b>clang -fvisibility=default   -target powerpc-unknown-linux   -emit-llvm  -S test.c</b><br>
   <br>
   Generate IR as :<br>
    <b>@b = protected global i32 0, align 4 </b> <u></u><u></u></p>
</div>
</div>
</div>
</div>

_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>