Skip to content

Commit 368b55f

Browse files
committed
Darwin: Update handling of long constant names.
The long(er) names we are using for contracts constants (e.g. Lcontract_violation) is triggering a warning where the prefix to ASM_GENERATE_INTERNAL_LABEL is shorter than our literal; that warning becomes an error after stage1 and so needs to be fixed to allow bootstrap on Darwin. This needs to be fixed more generally for Darwin upstream but the patch here is sufficient for the contracts branch and stage Signed-off-by: Iain Sandoe <[email protected]>
1 parent d8935b4 commit 368b55f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gcc/config/darwin.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,9 +996,11 @@ extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS];
996996
sprintf (LABEL, "*%s%ld", "lASAN", (long)(NUM));\
997997
else if (strcmp ("LTRAMP", PREFIX) == 0) \
998998
sprintf (LABEL, "*%s%ld", "lTRAMP", (long)(NUM));\
999-
else if (strcmp ("Lcontract_violation", PREFIX) == 0) \
999+
else if (strlen (PREFIX) == 19 \
1000+
&& strcmp ("Lcontract_violation", PREFIX) == 0) \
10001001
sprintf (LABEL, "*%s%ld", "lcontract_violation", (long)(NUM));\
1001-
else if (strcmp ("Lsrc_loc_impl.", PREFIX) == 0) \
1002+
else if (strlen (PREFIX) == 13 \
1003+
&& strcmp ("Lsrc_loc_impl", PREFIX) == 0) \
10021004
sprintf (LABEL, "*%s%ld", "lsrc_loc_impl", (long)(NUM));\
10031005
else \
10041006
sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)); \

0 commit comments

Comments
 (0)