<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<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.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-Eli<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> cfe-dev <cfe-dev-bounces@lists.llvm.org> <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> cfe-dev@lists.llvm.org<br>
<b>Subject:</b> [EXT] [cfe-dev] add new option -fnovisibility for clang<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></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). <o:p></o:p></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> <o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>