Skip to content

Bug: Compilation fails with gcc 15 without threading enabled #164

@jcarrete5

Description

@jcarrete5

Problem/Opportunity

Building tasecureapi with a compiler that doesn't support threads.h fails, despite the existence of a header under reference/include/ to provide this file if it's missing.

$ cmake --build build-gcc/
[112/128] Building C object src/client/CMakeFiles/saclient.dir/src/sa_provider.c.o
FAILED: [code=1] src/client/CMakeFiles/saclient.dir/src/sa_provider.c.o
/opt/homebrew/bin/gcc-15 -Dsaclient_EXPORTS -I/Users/jcarre110/Git/tasecureapi/reference/src/client/include -I/Users/jcarre110/Git/tasecureapi/reference/src/client/../util/include -I/Users/jcarre110/Git/tasecureapi/reference/src/client/src -I/opt/homebrew/Cellar/openssl@3/3.6.1/include -I/Users/jcarre110/Git/tasecureapi/reference/src/util/include -I/Users/jcarre110/Git/tasecureapi/reference/src/util/../client/include -D_GNU_SOURCE -fPIC  -g -std=gnu11 -arch arm64 -fPIC -Werror -Wall -Wextra -Wno-type-limits -Wno-unused-parameter -Wno-deprecated-declarations -MD -MT src/client/CMakeFiles/saclient.dir/src/sa_provider.c.o -MF src/client/CMakeFiles/saclient.dir/src/sa_provider.c.o.d -o src/client/CMakeFiles/saclient.dir/src/sa_provider.c.o -c /Users/jcarre110/Git/tasecureapi/reference/src/client/src/sa_provider.c
/Users/jcarre110/Git/tasecureapi/reference/src/client/src/sa_provider.c:33:10: fatal error: threads.h: No such file or directory
   33 | #include <threads.h>
      |          ^~~~~~~~~~~
compilation terminated.
[123/128] Building C object src/client/CMakeFiles/saclient.dir/src/sa_provider_keymgt.c.o
ninja: build stopped: subcommand failed.

Steps to reproduce

  1. Install gcc from homebrew: brew install gcc
  2. CC=gcc-15 CXX=g++-15 cmake -B build-gcc -S reference
  3. cmake --build build-gcc

Expected Behavior

Program should compile.

Actual Behavior

Program doesn't compile.

Notes (Optional)

Should be able to resolve by add reference/include to the include directories when compiling sources under reference/src/client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions