<html>
    <head>
      <base href="http://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 --- - [cmake] LLVM tests fails with 'program used external function '_GLOBAL_OFFSET_TABLE_' which could not be resolved!'"
   href="http://llvm.org/bugs/show_bug.cgi?id=18329">18329</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[cmake] LLVM tests fails with 'program used external function '_GLOBAL_OFFSET_TABLE_' which could not be resolved!'
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>mgorny@gentoo.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm working on switching our LLVM build from autoconf to cmake, and in the most
basic conversion I'm getting a dozen of those issues in LLVM tests (the basic
ones supplied in llvm repo):

FAIL: LLVM :: ExecutionEngine/MCJIT/cross-module-sm-pic-a.ll (5234 of 9490)
******************** TEST 'LLVM ::
ExecutionEngine/MCJIT/cross-module-sm-pic-a.ll' FAILED ********************
Script:
--
/var/tmp/portage/sys-devel/llvm-9999-r1/work/llvm-9999-x86/bin/./lli -use-mcjit
-extra-module=/var/tmp/portage/sys-devel/llvm-9999-r1/work/llvm-9999/test/ExecutionEngine/MCJIT/Inputs/cross-module-b.ll
-relocation-model=pic -code-model=small
/var/tmp/portage/sys-devel/llvm-9999-r1/work/llvm-9999/test/ExecutionEngine/MCJIT/cross-module-sm-pic-a.ll
<span class="quote">> /dev/null</span >
--
Exit Code: 1

Command Output (stderr):
--
LLVM ERROR: Program used external function '_GLOBAL_OFFSET_TABLE_' which could
not be resolved!

--

The autotools build does seem to work fine.

cmake command-line:

cmake --no-warn-unused-cli -C
/var/tmp/portage/sys-devel/llvm-9999-r1/work/llvm-9999-x86/gentoo_common_config.cmake
-G Unix Makefiles -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON
-DFFI_INCLUDE_DIR=/usr/lib64/libffi-3.0.13/include -DLLVM_TARGETS_TO_BUILD=all
-DLLVM_ENABLE_FFI=ON -DLLVM_ENABLE_ASSERTIONS=OFF
-DLLVM_BINUTILS_INCDIR=/usr/include -DLLVM_BUILD_TESTS=ON
-DLLVM_LIBDIR_SUFFIX=32 -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_INSTALL_DO_STRIP=OFF
-DCMAKE_USER_MAKE_RULES_OVERRIDE=/var/tmp/portage/sys-devel/llvm-9999-r1/work/llvm-9999-x86/gentoo_rules.cmake
 /var/tmp/portage/sys-devel/llvm-9999-r1/work/llvm-9999

autoconf command-line (for comparison):

/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999/configure --prefix=/usr
--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man
--infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
--localstatedir=/var/lib --libdir=/usr/lib32 --disable-timestamps
--enable-keep-symbols --enable-shared --with-optimize-option=
--enable-optimized --disable-assertions --disable-expensive-checks
--enable-terminfo --enable-libffi ac_cv_prog_XML2CONFIG= --enable-targets=all
--enable-bindings=none --with-udis86</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>