SWDEV-431315 - mark stack as non executable in hiprtc generated header

Reference: https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart

Change-Id: I66860eb3787b8c835c52168dcf7a084982f0d7e6
This commit is contained in:
Jatin Chaudhary
2023-11-07 15:51:25 +00:00
committed by Jatin Jaikishan Chaudhary
szülő db909b2a1e
commit 14cbd8d24c
2 fájl változott, egészen pontosan 12 új sor hozzáadva és 1 régi sor törölve
+11 -1
Fájl megtekintése
@@ -110,8 +110,17 @@ cat >$tmp/hip_pch.h <<EOF
#include "hip/hip_fp16.h"
EOF
cat >$tmp/hip_pch.mcin <<EOF
cat << EOF > $tmp/hip_pch.mcin
.type __hip_pch_wave32,@object
EOF
if [[ $isWindows -eq 0 ]]; then
cat << EOF >> $tmp/hip_pch.mcin
.section .note.GNU-stack,"",@progbits
EOF
fi
cat << EOF >> $tmp/hip_pch.mcin
.section .hip_pch_wave32,"aMS",@progbits,1
.data
.globl __hip_pch_wave32
@@ -178,6 +187,7 @@ EOF
echo "// Automatically generated script for HIP RTC." > $mcinFile
if [[ $isWindows -eq 0 ]]; then
echo " .section .note.GNU-stack,"",@progbits" >> $mcinFile
echo " .type __hipRTC_header,@object" >> $mcinFile
echo " .type __hipRTC_header_size,@object" >> $mcinFile
fi
@@ -113,6 +113,7 @@ macro(generate_hiprtc_mcin HiprtcMcin HiprtcPreprocessedInput)
set(HIPRTC_TYPE_LINUX_ONLY "")
else()
set(HIPRTC_TYPE_LINUX_ONLY
" .section .note.GNU-stack,\"\",@progbits\n"
" .type __hipRTC_header,@object\n"
" .type __hipRTC_header_size,@object")
endif()