<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Clang/LLVM expose a weak symbol, preventing us linking."
   href="https://bugs.llvm.org/show_bug.cgi?id=48563">48563</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang/LLVM expose a weak symbol, preventing us linking.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>kalamatee@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We use an ASM macro to create an Alias extensively in our operating system,
however under LLVM/Clang it does not work, preventing us using the LLVM
toolchain from compiling the Operating System (www.aros.org).

#define __AROS_GM_STACKALIAS(fname, alias) \
    void alias(void); \
    asm(".weak " __GM_STRINGIZE(alias) "\n" \
        "\t.set " __GM_STRINGIZE(alias) "," #fname \
    );

The following is a simplified testcase showing the behaviour -:

extern void foo(void);
void bar(void);

asm(".weak foo\n"
        "\t.set foo,bar");

void*functable[] =
{
    &foo,
    (void *)0
};

When this is compiled with GNU/GCC, we only have 2 symbols exposed - "bar", and
"functable", however with LLVM/Clang - there is also a weak reference for "foo"
exposed, which then is not resolved during linking.</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>