WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: CorePure64 16.0 - GSL build fails  (Read 413 times)

Offline efarayenkay

  • Newbie
  • *
  • Posts: 3
CorePure64 16.0 - GSL build fails
« on: May 28, 2025, 10:22:45 PM »
Hi all

I'm trying to build iptsd to see if I can get a $urface Pro touchscreen working in TinyCore, and for that I need to build a number of prerequisites. All of the missing ones have worked great, save for one - Microsoft GSL. It hits an internal compiler error when I try to run the build:

Code: [Select]
tc@box:/mnt/sda1/tce/build$ wget https://github.com/microsoft/GSL/archive/refs/tags/v4.2.0.tar.gz
Connecting to github.com (140.82.112.3:443)
Connecting to codeload.github.com (4.237.22.35:443)
saving to 'v4.2.0.tar.gz'
v4.2.0.tar.gz        100% |*********************************************************************************************************************************************************************************************| 62240  0:00:00 ETA
'v4.2.0.tar.gz' saved
tc@box:/mnt/sda1/tce/build$ tar -xvf v4.2.0.tar.gz
GSL-4.2.0/
GSL-4.2.0/.clang-format
GSL-4.2.0/.gitattributes
GSL-4.2.0/.github/
GSL-4.2.0/.github/ISSUE_TEMPLATE/
GSL-4.2.0/.github/ISSUE_TEMPLATE/bug_report.md
GSL-4.2.0/.github/workflows/
GSL-4.2.0/.github/workflows/android.yml
GSL-4.2.0/.github/workflows/cmake/
GSL-4.2.0/.github/workflows/cmake/action.yml
GSL-4.2.0/.github/workflows/cmake_find_package.yml
GSL-4.2.0/.github/workflows/compilers.yml
GSL-4.2.0/.github/workflows/ios.yml
GSL-4.2.0/.gitignore
GSL-4.2.0/CMakeLists.txt
GSL-4.2.0/CMakeSettings.json
GSL-4.2.0/CONTRIBUTING.md
GSL-4.2.0/GSL.natvis
GSL-4.2.0/LICENSE
GSL-4.2.0/README.md
GSL-4.2.0/SECURITY.md
GSL-4.2.0/ThirdPartyNotices.txt
GSL-4.2.0/docs/
GSL-4.2.0/docs/headers.md
GSL-4.2.0/include/
GSL-4.2.0/include/CMakeLists.txt
GSL-4.2.0/include/gsl/
GSL-4.2.0/include/gsl/algorithm
GSL-4.2.0/include/gsl/assert
GSL-4.2.0/include/gsl/byte
GSL-4.2.0/include/gsl/gsl
GSL-4.2.0/include/gsl/narrow
GSL-4.2.0/include/gsl/pointers
GSL-4.2.0/include/gsl/span
GSL-4.2.0/include/gsl/span_ext
GSL-4.2.0/include/gsl/util
GSL-4.2.0/include/gsl/zstring
GSL-4.2.0/tests/
GSL-4.2.0/tests/CMakeLists.txt
GSL-4.2.0/tests/CMakeLists.txt.in
GSL-4.2.0/tests/algorithm_tests.cpp
GSL-4.2.0/tests/assertion_tests.cpp
GSL-4.2.0/tests/at_tests.cpp
GSL-4.2.0/tests/byte_tests.cpp
GSL-4.2.0/tests/deathTestCommon.h
GSL-4.2.0/tests/no_exception_ensure_tests.cpp
GSL-4.2.0/tests/notnull_tests.cpp
GSL-4.2.0/tests/owner_tests.cpp
GSL-4.2.0/tests/pointers_tests.cpp
GSL-4.2.0/tests/span_compatibility_tests.cpp
GSL-4.2.0/tests/span_ext_tests.cpp
GSL-4.2.0/tests/span_tests.cpp
GSL-4.2.0/tests/strict_notnull_tests.cpp
GSL-4.2.0/tests/utils_tests.cpp
tc@box:/mnt/sda1/tce/build$ cd GSL-4.2.0/
tc@box:/mnt/sda1/tce/build/GSL-4.2.0$ mkdir build; cd build
tc@box:/mnt/sda1/tce/build/GSL-4.2.0/build$ cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_INSTALL_LIBDIR=/usr/local/lib -D BUILD_SHARED_LIBS=ON ..
-- The CXX compiler identification is GNU 14.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Checking for one of the modules 'gtest_main'
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /mnt/sda1/tce/build/GSL-4.2.0/build/tests/googletest-download
[ 11%] Creating directories for 'googletest'
[ 22%] Performing download step (git clone) for 'googletest'
Cloning into 'googletest-src'...
HEAD is now at f8d7d77c Bump version to v1.14 in preparation for release
[ 33%] Performing update step for 'googletest'
-- Already at requested tag: v1.14.0
[ 44%] No patch step for 'googletest'
[ 55%] No configure step for 'googletest'
[ 66%] No build step for 'googletest'
[ 77%] No install step for 'googletest'
[ 88%] No test step for 'googletest'
[100%] Completed 'googletest'
[100%] Built target googletest
-- The C compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python3: /usr/local/bin/python3.9 (found version "3.9.21") found components: Interpreter
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test WARN_UNSAFE_BUFFER
-- Performing Test WARN_UNSAFE_BUFFER - Success
-- Configuring done (14.5s)
-- Generating done (0.0s)
-- Build files have been written to: /mnt/sda1/tce/build/GSL-4.2.0/build
tc@box:/mnt/sda1/tce/build/GSL-4.2.0/build$ make
[  5%] Building CXX object tests/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 10%] Linking CXX shared library ../../../lib/libgtest.so
[ 10%] Built target gtest
[ 15%] Building CXX object tests/googletest-build/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[ 21%] Linking CXX shared library ../../../lib/libgtest_main.so
[ 21%] Built target gtest_main
[ 26%] Building CXX object tests/CMakeFiles/gsl_tests.dir/algorithm_tests.cpp.o
[ 31%] Building CXX object tests/CMakeFiles/gsl_tests.dir/assertion_tests.cpp.o
[ 36%] Building CXX object tests/CMakeFiles/gsl_tests.dir/at_tests.cpp.o
[ 42%] Building CXX object tests/CMakeFiles/gsl_tests.dir/byte_tests.cpp.o
[ 47%] Building CXX object tests/CMakeFiles/gsl_tests.dir/notnull_tests.cpp.o
[ 52%] Building CXX object tests/CMakeFiles/gsl_tests.dir/owner_tests.cpp.o
/mnt/sda1/tce/build/GSL-4.2.0/tests/owner_tests.cpp: In substitution of 'template<class U> constexpr const bool OwnerCompilesFor<U, void_t<decltype (gsl::owner<U>{})> > [with U = int]':
/mnt/sda1/tce/build/GSL-4.2.0/tests/owner_tests.cpp:49:16:   required from here
   49 | static_assert(!OwnerCompilesFor<int>, "!OwnerCompilesFor<int>");
      |                ^~~~~~~~~~~~~~~~~~~~~
/mnt/sda1/tce/build/GSL-4.2.0/tests/owner_tests.cpp:49:16: internal compiler error: in convert_nontype_argument, at cp/pt.cc:7877
0x55dc02e0dfab internal_error(char const*, ...)
        ???:0
0x55dc01bcbc7b fancy_abort(char const*, int, char const*)
        ???:0
0x55dc01cf596d tsubst_expr(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x55dc01cfbbc0 tsubst_template_arg(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x55dc01d0530c tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x55dc01cfa3eb tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x55dc01cf78b4 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x55dc01cfb5d4 tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x55dc01d0530c tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x55dc01d07349 tsubst_argument_pack(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x55dc01d05305 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x55dc01cfa3eb tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x55dc01d0530c tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x55dc01cf4787 most_specialized_partial_spec(tree_node*, int, bool)
        ???:0
0x55dc01cf4c7a instantiate_template(tree_node*, tree_node*, int)
        ???:0
0x55dc01d22c0e finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*, bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
        ???:0
0x55dc01ce123f c_parse_file()
        ???:0
0x55dc01da5caa c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[2]: *** [tests/CMakeFiles/gsl_tests.dir/build.make:149: tests/CMakeFiles/gsl_tests.dir/owner_tests.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:200: tests/CMakeFiles/gsl_tests.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

I tried to replicate this in other places in case it was specific to TinyCore - it works in Ubuntu Plucky (glibc) but fails in Alpine Linux 3.21 (musl), both have the same version of g++. I also tried installing googletest from tce but it still insists on pulling the bleeding edge from Google's github.

If anyone has an account in GCC's Bugzilla and is able to reproduce this, could you please do so - I've requested an account but I suspect the odds that I'll get one are low.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15182
Re: CorePure64 16.0 - GSL build fails
« Reply #1 on: May 29, 2025, 04:38:29 AM »
It builds if you use clang instead of gcc.

Note that you'll need:
Code: [Select]
cd /usr/local/bin
sudo cp /tmp/tcloop/clang/usr/local/bin/clang-19 ./
sudo ln -sf clang-19 clang
sudo ln -sf clang-19 clang++

cd GSL-4.2.0

mkdir build
cd build

cmake -LAH -DCMAKE_C_COMPILER=/usr/local/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/bin/clang++ -DCMAKE_C_FLAGS_RELEASE="-flto -mtune=generic -Os -pipe" -DCMAKE_CXX_FLAGS_RELEASE="-flto -mtune=generic -Os -pipe" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=TRUE ../

make
sudo make install

Offline efarayenkay

  • Newbie
  • *
  • Posts: 3
Re: CorePure64 16.0 - GSL build fails
« Reply #2 on: May 29, 2025, 06:04:48 PM »
I'll take that for a spin - thanks! Didn't even think to try using clang.