proc check_effective_target_hwaddress_exec {} {
if ![check_runtime hwaddress_exec {
- int main (void) { return 0; }
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ extern int prctl(int, unsigned long, unsigned long, unsigned long, unsigned long);
+ #ifdef __cplusplus
+ }
+ #endif
+ int main (void) {
+ #define PR_SET_TAGGED_ADDR_CTRL 55
+ #define PR_GET_TAGGED_ADDR_CTRL 56
+ #define PR_TAGGED_ADDR_ENABLE (1UL << 0)
+ if (prctl (PR_GET_TAGGED_ADDR_CTRL, 0, 0, 0, 0) == -1)
+ return 1;
+ if (prctl(PR_SET_TAGGED_ADDR_CTRL, PR_TAGGED_ADDR_ENABLE, 0, 0, 0) == -1
+ || !prctl(PR_GET_TAGGED_ADDR_CTRL, 0, 0, 0, 0))
+ return 1;
+ return 0;
+ }
}] {
return 0;
}