Add attribute defines to compiler.h and -include compiler.h.

If we don't -include compiler.h it's important to always include the header with the attribute defines before they are used. Otherwise the compiler will silently "fail" by defining variables named the attribute define (e.g. __mpalign__). Another option is to remove the attribute defines, but I kind of like them.
上级 f25448ff
......@@ -21,7 +21,7 @@ OBJCOPY = $(TOOLPREFIX)objcopy
CFLAGS = -fno-pic -static -fno-builtin -fno-strict-aliasing -O2 -Wall -MD -ggdb \
-m64 -Werror -std=c99 -fms-extensions -mno-sse -mcmodel=large -I$(QEMUSRC) \
-fno-omit-frame-pointer -DHW_$(HW) -include param.h
-fno-omit-frame-pointer -DHW_$(HW) -include param.h -include compiler.h
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
ASFLAGS = -m64 -gdwarf-2 -MD
LDFLAGS += -m elf_x86_64
......
#define __padout__ char __padout[0] __attribute__((aligned(CACHELINE)))
#define __mpalign__ __attribute__((aligned(CACHELINE)))
#define __noret__ __attribute__((noreturn))
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论