From d44221f9c8f3686e040ff9481829315068b321a3 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Thu, 4 Oct 2018 23:42:42 +0200 Subject: Move compiler.h to commonlib Its spreading copies got out of sync. And as it is not a standard header but used in commonlib code, it belongs into commonlib. While we are at it, always include it via GCC's `-include` switch. Some Windows and BSD quirk handling went into the util copies. We always guard from redefinitions now to prevent further issues. Change-Id: I850414e6db1d799dce71ff2dc044e6a000ad2552 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/28927 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- util/cbfstool/Makefile.inc | 3 ++- util/cbfstool/cbfs.h | 1 - util/cbfstool/compiler.h | 38 -------------------------------------- util/cbfstool/fit.c | 1 - util/cbfstool/flashmap/fmap.h | 1 - util/cbfstool/ifwitool.c | 1 - 6 files changed, 2 insertions(+), 43 deletions(-) delete mode 100644 util/cbfstool/compiler.h (limited to 'util/cbfstool') diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc index 8e4d8b6f4e..1787eb14c0 100644 --- a/util/cbfstool/Makefile.inc +++ b/util/cbfstool/Makefile.inc @@ -80,6 +80,7 @@ TOOLCPPFLAGS += -I$(top)/util/cbfstool/flashmap TOOLCPPFLAGS += -I$(top)/util/cbfstool TOOLCPPFLAGS += -I$(objutil)/cbfstool TOOLCPPFLAGS += -I$(top)/src/commonlib/include +TOOLCPPFLAGS += -include $(top)/src/commonlib/include/commonlib/compiler.h TOOLCPPFLAGS += -DNEED_VB2_SHA_LIBRARY TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/firmware/include TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/firmware/2lib/include @@ -131,7 +132,7 @@ $(objutil)/cbfstool/%.o: $(top)/src/commonlib/%.c $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lz4/lib/%.c printf " HOSTCC $(subst $(objutil)/,,$(@))\n" - $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -include $(top)/util/cbfstool/compiler.h -c -o $@ $< + $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< $(objutil)/cbfstool/cbfstool: $(addprefix $(objutil)/cbfstool/,$(cbfsobj)) printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" diff --git a/util/cbfstool/cbfs.h b/util/cbfstool/cbfs.h index fd2457a573..b082d8c783 100644 --- a/util/cbfstool/cbfs.h +++ b/util/cbfstool/cbfs.h @@ -18,7 +18,6 @@ #include "common.h" #include -#include #include diff --git a/util/cbfstool/compiler.h b/util/cbfstool/compiler.h deleted file mode 100644 index cf043d5893..0000000000 --- a/util/cbfstool/compiler.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright 2017 Google Inc. - * Copyright (c) 2017-2018 Eltan B.V. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef __COMPILER_H__ -#define __COMPILER_H__ - -#if !defined(__FreeBSD__) - -#if !defined(__packed) -#if defined(__WIN32) || defined(__WIN64) -#define __packed __attribute__((gcc_struct, packed)) -#else -#define __packed __attribute__((packed)) -#endif -#endif - -#if !defined(__aligned) -#define __aligned(x) __attribute__((aligned(x))) -#endif -#endif - -#define __always_unused __attribute__((unused)) -#define __must_check __attribute__((warn_unused_result)) - -#endif diff --git a/util/cbfstool/fit.c b/util/cbfstool/fit.c index ad9ab37855..aeb1755032 100644 --- a/util/cbfstool/fit.c +++ b/util/cbfstool/fit.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "fit.h" diff --git a/util/cbfstool/flashmap/fmap.h b/util/cbfstool/flashmap/fmap.h index 017d332ef9..6e2091fc4f 100644 --- a/util/cbfstool/flashmap/fmap.h +++ b/util/cbfstool/flashmap/fmap.h @@ -37,7 +37,6 @@ #define FLASHMAP_LIB_FMAP_H__ #include -#include #include #define FMAP_SIGNATURE "__FMAP__" diff --git a/util/cbfstool/ifwitool.c b/util/cbfstool/ifwitool.c index c427339a48..1fbb61bfac 100644 --- a/util/cbfstool/ifwitool.c +++ b/util/cbfstool/ifwitool.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "common.h" -- cgit v1.2.3