Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22016

Setting stack size in cmake with gcc

$
0
0

I am building a C++ project on Linux using gcc 9.2 and cmake 3.15, and I need to increase the default stack size. I found many answers before, but none of them seems to work

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,1000000")
message(${CMAKE_CXX_COMPILER_ID})
message(${CMAKE_EXE_LINKER_FLAGS})

It gives an error:

/usr/bin/ld: unrecognized option '--stack'
/usr/bin/ld: use the --help option for usage information

I can see the argument is indeed is passed in the cmake output:

GNU
-Wl,--stack,1000000

And this following flag doesn't seems to exist at all.

set(CMAKE_CXX_STACK_SIZE 1000000)

Viewing all articles
Browse latest Browse all 22016

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>