Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with Clang #27

Closed
tritao opened this issue Jan 26, 2019 · 9 comments
Closed

Build fails with Clang #27

tritao opened this issue Jan 26, 2019 · 9 comments

Comments

@tritao
Copy link

tritao commented Jan 26, 2019

Hello.

I am trying to build the project using Clang/LLD as a host compiler on Linux.

Everything seems to go well until widl tool is built from mingw-w64-tools/widl.

It fails with:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... i686-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for widl includedir... $(includedir)/../$(target)/include
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/media/joao/dev/llvm-mingw/mingw-w64/mingw-w64-tools/widl/build-i686':
configure: error: C compiler cannot create executables
See `config.log' for more details

config.log:

configure:3174: checking for gcc
configure:3190: found /usr/bin/gcc
configure:3201: result: gcc
configure:3430: checking for C compiler version
configure:3439: gcc --version >&5
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3450: $? = 0
configure:3439: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04) 
configure:3450: $? = 0
configure:3439: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3450: $? = 1
configure:3439: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3450: $? = 1
configure:3470: checking whether the C compiler works
configure:3492: gcc   -Wl,-s conftest.c  >&5
/usr/bin/ld: error: unknown argument: --push-state
/usr/bin/ld: error: unknown argument: --pop-state
/usr/bin/ld: error: unknown argument: --push-state
/usr/bin/ld: error: unknown argument: --pop-state
collect2: error: ld returned 1 exit status

Is using clang as host compiler not a supported configuration?

@tritao
Copy link
Author

tritao commented Jan 26, 2019

diff --git a/build-mingw-w64.sh b/build-mingw-w64.sh
index e8f2d1d..d6d040d 100755
--- a/build-mingw-w64.sh
+++ b/build-mingw-w64.sh
@@ -120,7 +120,8 @@ cd mingw-w64-tools/widl
 for arch in $ARCHS; do
     mkdir -p build-$CROSS_NAME$arch
     cd build-$CROSS_NAME$arch
-    ../configure --prefix=$PREFIX --target=$arch-w64-mingw32 $CONFIGFLAGS LDFLAGS="-Wl,-s"
+    ../configure --prefix=$PREFIX --target=$arch-w64-mingw32 $CONFIGFLAGS LDFLAGS="-Wl,-s" \
+        CC=cc AR=llvm-ar RANLIB=llvm-ranlib DLLTOOL=llvm-dlltool
     make -j$CORES
     make install
     cd ..
@@ -133,3 +134,4 @@ if [ -n "$SKIP_INCLUDE_TRIPLET_PREFIX" ]; then
         fi
     done
 fi
+

This patch seems enough to make it build, but not sure if its the best approach? Possibly it would be best to allow a cc= argument to the build scripts that is threaded down to these child build scripts.

@tritao tritao changed the title widl build fails with Clang Build fails with Clang Jan 26, 2019
@tritao
Copy link
Author

tritao commented Jan 26, 2019

libunwind failure:

-- The C compiler identification is Clang 9.0.0
-- The CXX compiler identification is Clang 9.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - failed
-- Found LLVM_CONFIG_PATH as /usr/bin/llvm-config
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Failed
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Failed
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Failed
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Success
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Success
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Failed
-- Looking for fopen in c
-- Looking for fopen in c - not found
-- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG
-- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG - Success
-- Found compiler-rt library: /media/joao/dev/llvm-mingw/out/lib/clang/9.0.0/lib/windows/libclang_rt.builtins-i386.a
-- Performing Test LIBUNWIND_HAS_FUNWIND_TABLES
-- Performing Test LIBUNWIND_HAS_FUNWIND_TABLES - Success
-- Performing Test LIBUNWIND_HAS_NO_EXCEPTIONS_FLAG
-- Performing Test LIBUNWIND_HAS_NO_EXCEPTIONS_FLAG - Success
-- Performing Test LIBUNWIND_HAS_NO_RTTI_FLAG
-- Performing Test LIBUNWIND_HAS_NO_RTTI_FLAG - Success
-- Performing Test LIBUNWIND_HAS_FSTRICT_ALIASING_FLAG
-- Performing Test LIBUNWIND_HAS_FSTRICT_ALIASING_FLAG - Success
-- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG
-- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WALL_FLAG
-- Performing Test LIBUNWIND_HAS_WALL_FLAG - Success
-- Performing Test LIBUNWIND_HAS_W_FLAG
-- Performing Test LIBUNWIND_HAS_W_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WNO_UNUSED_FUNCTION_FLAG
-- Performing Test LIBUNWIND_HAS_WNO_UNUSED_FUNCTION_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WUNUSED_VARIABLE_FLAG
-- Performing Test LIBUNWIND_HAS_WUNUSED_VARIABLE_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WUNUSED_PARAMETER_FLAG
-- Performing Test LIBUNWIND_HAS_WUNUSED_PARAMETER_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WSTRICT_ALIASING_FLAG
-- Performing Test LIBUNWIND_HAS_WSTRICT_ALIASING_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WSTRICT_OVERFLOW_FLAG
-- Performing Test LIBUNWIND_HAS_WSTRICT_OVERFLOW_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WWRITE_STRINGS_FLAG
-- Performing Test LIBUNWIND_HAS_WWRITE_STRINGS_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WCHAR_SUBSCRIPTS_FLAG
-- Performing Test LIBUNWIND_HAS_WCHAR_SUBSCRIPTS_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WMISMATCHED_TAGS_FLAG
-- Performing Test LIBUNWIND_HAS_WMISMATCHED_TAGS_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WMISSING_BRACES_FLAG
-- Performing Test LIBUNWIND_HAS_WMISSING_BRACES_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WSHORTEN_64_TO_32_FLAG
-- Performing Test LIBUNWIND_HAS_WSHORTEN_64_TO_32_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WSIGN_CONVERSION_FLAG
-- Performing Test LIBUNWIND_HAS_WSIGN_CONVERSION_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WSIGN_COMPARE_FLAG
-- Performing Test LIBUNWIND_HAS_WSIGN_COMPARE_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WSHADOW_FLAG
-- Performing Test LIBUNWIND_HAS_WSHADOW_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WCONVERSION_FLAG
-- Performing Test LIBUNWIND_HAS_WCONVERSION_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WNEWLINE_EOF_FLAG
-- Performing Test LIBUNWIND_HAS_WNEWLINE_EOF_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WUNDEF_FLAG
-- Performing Test LIBUNWIND_HAS_WUNDEF_FLAG - Success
-- Performing Test LIBUNWIND_HAS_PEDANTIC_FLAG
-- Performing Test LIBUNWIND_HAS_PEDANTIC_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WERROR_FLAG
-- Performing Test LIBUNWIND_HAS_WERROR_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WNO_ERROR_FLAG
-- Performing Test LIBUNWIND_HAS_WNO_ERROR_FLAG - Success
-- Performing Test LIBUNWIND_HAS_WX_FLAG
-- Performing Test LIBUNWIND_HAS_WX_FLAG - Failed
-- Performing Test LIBUNWIND_HAS_NO_WX_FLAG
-- Performing Test LIBUNWIND_HAS_NO_WX_FLAG - Failed
-- Performing Test LIBUNWIND_HAS_EHSC_FLAG
-- Performing Test LIBUNWIND_HAS_EHSC_FLAG - Failed
-- Performing Test LIBUNWIND_HAS_NO_EHS_FLAG
-- Performing Test LIBUNWIND_HAS_NO_EHS_FLAG - Failed
-- Performing Test LIBUNWIND_HAS_NO_EHA_FLAG
-- Performing Test LIBUNWIND_HAS_NO_EHA_FLAG - Failed
-- Performing Test LIBUNWIND_HAS_NO_GR_FLAG
-- Performing Test LIBUNWIND_HAS_NO_GR_FLAG - Failed
-- Performing Test LIBUNWIND_HAS_STD_CXX11
-- Performing Test LIBUNWIND_HAS_STD_CXX11 - Success
-- Looking for dladdr in dl
-- Looking for dladdr in dl - not found
-- Looking for pthread_once in pthread
-- Looking for pthread_once in pthread - found
-- Configuring done
-- Generating done
-- Build files have been written to: /media/joao/dev/llvm-mingw/libunwind/build-i686-shared
Scanning dependencies of target unwind_objects
[ 11%] Building C object src/CMakeFiles/unwind_objects.dir/UnwindLevel1-gcc-ext.c.obj
[ 22%] Building CXX object src/CMakeFiles/unwind_objects.dir/libunwind.cpp.obj
[ 33%] Building C object src/CMakeFiles/unwind_objects.dir/UnwindRegistersRestore.S.obj
[ 44%] Building CXX object src/CMakeFiles/unwind_objects.dir/Unwind-EHABI.cpp.obj
[ 55%] Building C object src/CMakeFiles/unwind_objects.dir/Unwind-sjlj.c.obj
[ 66%] Building CXX object src/CMakeFiles/unwind_objects.dir/Unwind-seh.cpp.obj
[ 77%] Building C object src/CMakeFiles/unwind_objects.dir/UnwindLevel1.c.obj
[ 88%] Building C object src/CMakeFiles/unwind_objects.dir/UnwindRegistersSave.S.obj
In file included from /media/joao/dev/llvm-mingw/libunwind/src/libunwind.cpp:17:
In file included from /media/joao/dev/llvm-mingw/libcxx/include/new:91:
In file included from /media/joao/dev/llvm-mingw/libcxx/include/exception:83:
/media/joao/dev/llvm-mingw/libcxx/include/type_traits:744:56: error: _Float16 is not supported on this target
template <>          struct __libcpp_is_floating_point<_Float16>    : public true_type {};
                                                       ^
1 error generated.
src/CMakeFiles/unwind_objects.dir/build.make:63: recipe for target 'src/CMakeFiles/unwind_objects.dir/libunwind.cpp.obj' failed
make[2]: *** [src/CMakeFiles/unwind_objects.dir/libunwind.cpp.obj] Error 1
CMakeFiles/Makefile2:196: recipe for target 'src/CMakeFiles/unwind_objects.dir/all' failed
make[1]: *** [src/CMakeFiles/unwind_objects.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@tritao
Copy link
Author

tritao commented Jan 26, 2019

Relevant code from libcxx type_traits:

#ifdef __FLT16_MANT_DIG__
template <>          struct __libcpp_is_floating_point<_Float16>    : public true_type {};
#endif

This preprocessor define is set by Clang itself in clang/lib/Frontend/InitPreprocessor.cpp:

  DefineFloatMacros(Builder, "FLT16", &TI.getHalfFormat(), "F16");

It seems to always be set, independent of which target is set.

Also Clang disables the Float16 type by default on all targets, besides ARM.cpp and SPIR.h, as can be seen here:

clang/Basic/TargetInfo.cpp:

// TargetInfo Constructor.
TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) {
  ...
  HasFloat16 = false;
  ...
}

So it does seem to like a bug in the toolchain based on this info, but surely I am misunderstanding something here?

For what is worth, just commenting the relevant check line in type_traits makes the project compile successfully.

However I am not sure what's the best fix here. Any thoughts @mstorsjo?

@mstorsjo
Copy link
Owner

I am trying to build the project using Clang/LLD as a host compiler on Linux.

How is this environment set up more in detail? What distribution and in which way are they installed as host compiler/linker? By symlinking LLD to /usr/bin/ld and clang to /usr/bin/cc?

Can you provide the output of cc --version and ld --version?

It fails with:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... i686-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for widl includedir... $(includedir)/../$(target)/include
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/media/joao/dev/llvm-mingw/mingw-w64/mingw-w64-tools/widl/build-i686':
configure: error: C compiler cannot create executables
See `config.log' for more details

config.log:

configure:3174: checking for gcc
configure:3190: found /usr/bin/gcc
configure:3201: result: gcc
configure:3430: checking for C compiler version
configure:3439: gcc --version >&5
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3450: $? = 0
configure:3439: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04) 
configure:3450: $? = 0
configure:3439: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3450: $? = 1
configure:3439: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3450: $? = 1
configure:3470: checking whether the C compiler works
configure:3492: gcc   -Wl,-s conftest.c  >&5
/usr/bin/ld: error: unknown argument: --push-state
/usr/bin/ld: error: unknown argument: --pop-state
/usr/bin/ld: error: unknown argument: --push-state
/usr/bin/ld: error: unknown argument: --pop-state
collect2: error: ld returned 1 exit status

Is using clang as host compiler not a supported configuration?

Using clang as host compiler is most definitely supported. However, it seems like the version of LLD you have isn't compatible with your GCC frontend. The --push-state option was implemented in LLD 7.

This patch seems enough to make it build, but not sure if its the best approach? Possibly it would be best to allow a cc= argument to the build scripts that is threaded down to these child build scripts.

I don't feel that merging this patch is necessary, as the root cause is the fact that you do have gcc available, but it is unusable/broken.

I'll try to look into the other matter and get back to you on that.

@tritao
Copy link
Author

tritao commented Jan 26, 2019

How is this environment set up more in detail? What distribution and in which way are they installed as host compiler/linker? By symlinking LLD to /usr/bin/ld and clang to /usr/bin/cc?

It's Mint (Debian/Ubuntu-based). I used update-alternatives to set them as defaults.

Can you provide the output of cc --version and ld --version?

joao@joao-HP:/media/joao/dev/llvm-mingw$ clang --version
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
joao@joao-HP:/media/joao/dev/llvm-mingw$ ld --version
LLD 6.0.0 (compatible with GNU linkers)

Using clang as host compiler is most definitely supported. However, it seems like the version of LLD you have isn't compatible with your GCC frontend. The --push-state option was implemented in LLD 7.

I see, thanks for the information.

I might be misunderstanding the underlying problem, but it seems that the configure step is opting for gcc, instead of the default cc compiler, hence why I tried passing it the cc compiler explicitly.

configure:3174: checking for gcc
configure:3190: found /usr/bin/gcc

@mstorsjo
Copy link
Owner

I might be misunderstanding the underlying problem, but it seems that the configure step is opting for gcc, instead of the default cc compiler, hence why I tried passing it the cc compiler explicitly.

configure:3174: checking for gcc
configure:3190: found /usr/bin/gcc

Yes, the autoconf based tools will prefer using gcc instead of cc, if gcc exists. But then in your case, gcc is broken. You can try to compile a test C file (you can test e.g. test/hello.c from llvm-mingw), and you should see that it is broken in the same way as you saw in config.log. E.g. gcc test/hello.c should fail in the same way.

And yes, configuring with CC=cc will work. But I don't find it worthwhile to add plumbing to all the scripts to pass this variable through to the necessary places and merge this into my maintained version, when the root cause is that you have gcc but it is broken (incompatible with your default linker). Either fix it (by upgrading LLD to 7), remove your gcc tool so that autoconf doesn't try that before cc, or locally add the CC=cc.

@mstorsjo
Copy link
Owner

As for the error about _Float16, it seems like you're running an untested combination of versions of the projects. You're building the version of libcxx that I have got pinned (from August 2018) - I haven't updated that one since then, just because I haven't seen any issues with it.

But for clang, you're not using the one I have pinned (from January 23rd), you seem to have one from yesterday or later.

The _Float16 data type was disabled on January 25th for non-ARM targets (https://github.com/llvm-project/clang/commit/c92e6f5affe17d94518ab62668d87ef7ee98575c), which breaks using the old pinned libcxx. In newer libcxx, this isn't an issue since the problematic lines were removed in October in https://github.com/llvm-project/libcxx/commit/842383f69ca18c1560da6dec2cd10147107655a2.

So, either stick strictly with the combination of pinned project versions which I have tested building together, or update all of them to the latest version (which I also test regularly).

@tritao
Copy link
Author

tritao commented Jan 26, 2019

About the first issue, you're right. Looks like my LLD is incompatible with the system GCC. I still think it's weird that this was seemingly the only project that uses gcc, instead of choosing the default system compiler. However I understand your decision of not wanting to add complexity here. I removed my system GCC instead so hopefully no mix-ups of this sort happen in the future.

About the second issue, I think I know what happened. I remember in my first run, I had an error about missing SVN (when calling git svn). I installed it, and called the build process again. Guess this messed up with the revision that was pulled.

Sorry for wasting your time on this.

@tritao tritao closed this as completed Jan 26, 2019
@mstorsjo
Copy link
Owner

About the first issue, you're right. Looks like my LLD is incompatible with the system GCC. I still think it's weird that this was seemingly the only project that uses gcc, instead of choosing the default system compiler.

I mostly depends on the build systems used; autoconf tests gcc before cc, while others probably try cc first.

About the second issue, I think I know what happened. I remember in my first run, I had an error about missing SVN (when calling git svn). I installed it, and called the build process again. Guess this messed up with the revision that was pulled.

Oh, ok, that explains it! Yes, if you have an existing chekout, it doesn't force checking out the pinned version. And git-svn is only needed for getting easy to read SVN versions from clang --version.

Normally, there's not too strict dependency between libcxx and the compiler version, this is the first issue of this kind that I've seen.

Sorry for wasting your time on this.

No problem, I'm glad that we got it resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants