mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] objtool: Hide unnecessary compiler error message
@ 2025-02-03  7:36 David Engraf
  2025-02-08  2:12 ` Josh Poimboeuf
  2025-03-14 20:04 ` [tip: objtool/core] " tip-bot2 for David Engraf
  0 siblings, 2 replies; 3+ messages in thread
From: David Engraf @ 2025-02-03  7:36 UTC (permalink / raw)
  To: jpoimboe, peterz; +Cc: linux-kernel, David Engraf

The check for using old libelf prints an error message when libelf.h is
not available but does not abort. This may confuse so hide the compiler
error message.

Signed-off-by: David Engraf <david.engraf@sysgo.com>
---
 tools/objtool/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index f56e277275341..38609e3612ba1 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -37,7 +37,7 @@ OBJTOOL_CFLAGS := -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBE
 OBJTOOL_LDFLAGS := $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)
 
 # Allow old libelf to be used:
-elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(HOSTCC) $(OBJTOOL_CFLAGS) -x c -E - | grep elf_getshdr)
+elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(HOSTCC) $(OBJTOOL_CFLAGS) -x c -E - 2>/dev/null | grep elf_getshdr)
 OBJTOOL_CFLAGS += $(if $(elfshdr),,-DLIBELF_USE_DEPRECATED)
 
 # Always want host compilation.
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] objtool: Hide unnecessary compiler error message
  2025-02-03  7:36 [PATCH] objtool: Hide unnecessary compiler error message David Engraf
@ 2025-02-08  2:12 ` Josh Poimboeuf
  2025-03-14 20:04 ` [tip: objtool/core] " tip-bot2 for David Engraf
  1 sibling, 0 replies; 3+ messages in thread
From: Josh Poimboeuf @ 2025-02-08  2:12 UTC (permalink / raw)
  To: David Engraf; +Cc: peterz, linux-kernel

On Mon, Feb 03, 2025 at 08:36:10AM +0100, David Engraf wrote:
> The check for using old libelf prints an error message when libelf.h is
> not available but does not abort. This may confuse so hide the compiler
> error message.
> 
> Signed-off-by: David Engraf <david.engraf@sysgo.com>
> ---
>  tools/objtool/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Queued, thanks!

-- 
Josh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: objtool/core] objtool: Hide unnecessary compiler error message
  2025-02-03  7:36 [PATCH] objtool: Hide unnecessary compiler error message David Engraf
  2025-02-08  2:12 ` Josh Poimboeuf
@ 2025-03-14 20:04 ` tip-bot2 for David Engraf
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for David Engraf @ 2025-03-14 20:04 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: David Engraf, Josh Poimboeuf, x86, linux-kernel

The following commit has been merged into the objtool/core branch of tip:

Commit-ID:     bf71940fc16953bed84caa59b7b076ead70d42f6
Gitweb:        https://git.kernel.org/tip/bf71940fc16953bed84caa59b7b076ead70d42f6
Author:        David Engraf <david.engraf@sysgo.com>
AuthorDate:    Mon, 03 Feb 2025 08:36:10 +01:00
Committer:     Josh Poimboeuf <jpoimboe@kernel.org>
CommitterDate: Wed, 12 Mar 2025 15:43:38 -07:00

objtool: Hide unnecessary compiler error message

The check for using old libelf prints an error message when libelf.h is
not available but does not abort. This may confuse so hide the compiler
error message.

Signed-off-by: David Engraf <david.engraf@sysgo.com>
Link: https://lore.kernel.org/r/20250203073610.206000-1-david.engraf@sysgo.com
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 tools/objtool/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 7a65948..8c20361 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -37,7 +37,7 @@ OBJTOOL_CFLAGS := -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBE
 OBJTOOL_LDFLAGS := $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)
 
 # Allow old libelf to be used:
-elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(HOSTCC) $(OBJTOOL_CFLAGS) -x c -E - | grep elf_getshdr)
+elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(HOSTCC) $(OBJTOOL_CFLAGS) -x c -E - 2>/dev/null | grep elf_getshdr)
 OBJTOOL_CFLAGS += $(if $(elfshdr),,-DLIBELF_USE_DEPRECATED)
 
 # Always want host compilation.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-14 20:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-03  7:36 [PATCH] objtool: Hide unnecessary compiler error message David Engraf
2025-02-08  2:12 ` Josh Poimboeuf
2025-03-14 20:04 ` [tip: objtool/core] " tip-bot2 for David Engraf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®