CMake: remove test for alloca for the global config

We don't test for this anywhere in qtbase except for the qmake check
(and qmake doesn't use alloca() anywhere). There are a couple of uses of
alloca() itself in qtbase, but they are all in platform-specific code
(android and qnx platform plugins) or third-party content (sqlite and
imgui).

The uses of this alloca() test in qtdeclarative have been removed too
(it still uses alloca() but has local tests).

Change-Id: If3345151ddf84c43a4f1fffd17d1f1519f5d3e39
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Thiago Macieira 2024-05-22 19:51:05 -03:00
parent d31f6496c9
commit afe50b1cf3
3 changed files with 1 additions and 70 deletions

View File

@ -416,55 +416,6 @@ int main(void)
} }
") ")
# alloca_stdlib_h
qt_config_compile_test(alloca_stdlib_h
LABEL "alloca() in stdlib.h"
CODE
"#include <stdlib.h>
int main(void)
{
/* BEGIN TEST: */
alloca(1);
/* END TEST: */
return 0;
}
")
# alloca_h
qt_config_compile_test(alloca_h
LABEL "alloca() in alloca.h"
CODE
"#include <alloca.h>
#ifdef __QNXNTO__
// extra include needed in QNX7 to define NULL for the alloca() macro
# include <stddef.h>
#endif
int main(void)
{
/* BEGIN TEST: */
alloca(1);
/* END TEST: */
return 0;
}
")
# alloca_malloc_h
qt_config_compile_test(alloca_malloc_h
LABEL "alloca() in malloc.h"
CODE
"#include <malloc.h>
int main(void)
{
/* BEGIN TEST: */
alloca(1);
/* END TEST: */
return 0;
}
")
# stack_protector # stack_protector
if(NOT WASM AND NOT VXWORKS) if(NOT WASM AND NOT VXWORKS)
# emcc doesn't support this, but the detection accidentally succeeds # emcc doesn't support this, but the detection accidentally succeeds
@ -1005,18 +956,6 @@ qt_feature("posix_fallocate" PRIVATE
LABEL "POSIX fallocate()" LABEL "POSIX fallocate()"
CONDITION TEST_posix_fallocate CONDITION TEST_posix_fallocate
) )
qt_feature("alloca_h" PRIVATE
LABEL "alloca.h"
CONDITION TEST_alloca_h
)
qt_feature("alloca_malloc_h" PRIVATE
LABEL "alloca() in malloc.h"
CONDITION NOT QT_FEATURE_alloca_h AND TEST_alloca_malloc_h
)
qt_feature("alloca" PRIVATE
LABEL "alloca()"
CONDITION QT_FEATURE_alloca_h OR QT_FEATURE_alloca_malloc_h OR TEST_alloca_stdlib_h
)
qt_feature("force-system-libs" PRIVATE qt_feature("force-system-libs" PRIVATE
LABEL "Force the usage of system libraries" LABEL "Force the usage of system libraries"
AUTODETECT OFF AUTODETECT OFF

View File

@ -33,13 +33,6 @@
#define QT_NO_DEPRECATED #define QT_NO_DEPRECATED
// Keep feature-test macros in alphabetic order by feature name: // Keep feature-test macros in alphabetic order by feature name:
#define QT_FEATURE_alloca 1
#define QT_FEATURE_alloca_h -1
#ifdef _WIN32
# define QT_FEATURE_alloca_malloc_h 1
#else
# define QT_FEATURE_alloca_malloc_h -1
#endif
#define QT_FEATURE_cborstreamreader -1 #define QT_FEATURE_cborstreamreader -1
#define QT_FEATURE_cborstreamwriter 1 #define QT_FEATURE_cborstreamwriter 1
#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1 #define QT_CRYPTOGRAPHICHASH_ONLY_SHA1

View File

@ -23,8 +23,7 @@ qt_feature("windeployqt" PRIVATE
qt_feature("qmake" PRIVATE qt_feature("qmake" PRIVATE
PURPOSE "The qmake tool helps simplify the build process for development projects across different platforms." PURPOSE "The qmake tool helps simplify the build process for development projects across different platforms."
CONDITION QT_FEATURE_settings AND QT_FEATURE_alloca AND CONDITION QT_FEATURE_settings AND QT_FEATURE_cborstreamwriter AND
(QT_FEATURE_alloca_malloc_h OR NOT WIN32) AND QT_FEATURE_cborstreamwriter AND
QT_FEATURE_datestring AND QT_FEATURE_regularexpression AND QT_FEATURE_temporaryfile) QT_FEATURE_datestring AND QT_FEATURE_regularexpression AND QT_FEATURE_temporaryfile)
qt_configure_add_summary_section(NAME "Core tools") qt_configure_add_summary_section(NAME "Core tools")