Skip to content

Improve CFAsmMacros platform checking #1692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CoreFoundation/Base.subproj/CFAsmMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
#define CONCAT_EXPANDED(a,b) CONCAT(a,b)
#define _C_LABEL(name) CONCAT_EXPANDED(__USER_LABEL_PREFIX__,name)

#if defined(__GNU__) || defined(__GNUC__) || defined(__ANDROID__) || defined(__FreeBSD__)
/* Use .note.GNU-stack to explicitly indicate a non-exec stack, b/c of bad */
/* default behaviour when translating handwritten assembly files (needed on */
/* GNU/* platforms, Android and FreeBSD, as tests have shown). */
/* Platform tests are documented at http://git.savannah.gnu.org/gitweb/?p=libffcall.git;a=blob;f=porting-tools/execstack/README */
#if (defined(__GNUC__) || defined (__llvm__) || defined (__clang__)) && defined(__ELF__) && (defined (__linux__) || defined (__linux) || defined (__gnu_linux__) || defined(__FreeBSD__) || defined (__FreeBSD_kernel__))
#define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits
#elsif defined(__SUNPRO_C) && defined(__linux__)
#define NO_EXEC_STACK_DIRECTIVE .section ".note.GNU-stack"
#else
#define NO_EXEC_STACK_DIRECTIVE
#endif
Expand Down