diff --git a/hipamd/src/hip_embed_pch.sh b/hipamd/src/hip_embed_pch.sh index 0fd53bf739..2d998407ae 100755 --- a/hipamd/src/hip_embed_pch.sh +++ b/hipamd/src/hip_embed_pch.sh @@ -110,8 +110,17 @@ cat >$tmp/hip_pch.h <$tmp/hip_pch.mcin < $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 diff --git a/hipamd/src/hiprtc/cmake/HIPRTC.cmake b/hipamd/src/hiprtc/cmake/HIPRTC.cmake index 02bd604e41..5bb125d009 100644 --- a/hipamd/src/hiprtc/cmake/HIPRTC.cmake +++ b/hipamd/src/hiprtc/cmake/HIPRTC.cmake @@ -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()