mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruen@suse.de>
To: linux-kernel@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Subject: [kbuild 5/5] Dont include absolute filenames in binaries
Date: Tue, 18 Jan 2005 19:41:23 +0100	[thread overview]
Message-ID: <20050118192608.655088000.suse.de> (raw)
In-Reply-To: <20050118184123.729034000.suse.de>

[-- Attachment #1: remove-buildenv-paths-from-binaries.diff --]
[-- Type: text/plain, Size: 2474 bytes --]

The kbuild utilities are compiled with absolute patch names, so paths
starting with $RPM_BUILD_ROOT would end up in the binaries.  To avoid
this, remove all references to __FILE__ (directly and indirectly via
assert()).

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>

Index: linux-2.6.11-rc1-bk6/scripts/genksyms/genksyms.h
===================================================================
--- linux-2.6.11-rc1-bk6.orig/scripts/genksyms/genksyms.h
+++ linux-2.6.11-rc1-bk6/scripts/genksyms/genksyms.h
@@ -25,7 +25,6 @@
 #define MODUTILS_GENKSYMS_H 1
 
 #include <stdio.h>
-#include <assert.h>
 
 
 enum symbol_type
@@ -89,8 +88,17 @@ void error_with_pos(const char *, ...);
 
 #define MODUTILS_VERSION "<in-kernel>"
 
-#define xmalloc(size) ({ void *__ptr = malloc(size); assert(__ptr || size == 0); __ptr; })
-#define xstrdup(str)  ({ char *__str = strdup(str); assert(__str); __str; })
-
+#define xmalloc(size) ({ void *__ptr = malloc(size);		\
+	if(!__ptr && size != 0) {				\
+		fprintf(stderr, "out of memory\n");		\
+		exit(1);					\
+	}							\
+	__ptr; })
+#define xstrdup(str)  ({ char *__str = strdup(str);		\
+	if (!__str) {						\
+		fprintf(stderr, "out of memory\n");		\
+		exit(1);					\
+	}							\
+	__str; })
 
 #endif /* genksyms.h */
Index: linux-2.6.11-rc1-bk6/scripts/mod/modpost.c
===================================================================
--- linux-2.6.11-rc1-bk6.orig/scripts/mod/modpost.c
+++ linux-2.6.11-rc1-bk6/scripts/mod/modpost.c
@@ -47,11 +47,10 @@ warn(const char *fmt, ...)
 	va_end(arglist);
 }
 
-void *do_nofail(void *ptr, const char *file, int line, const char *expr)
+void *do_nofail(void *ptr, const char *expr)
 {
 	if (!ptr) {
-		fatal("Memory allocation failure %s line %d: %s.\n",
-		      file, line, expr);
+		fatal("Memory allocation failure: %s.\n", expr);
 	}
 	return ptr;
 }
Index: linux-2.6.11-rc1-bk6/scripts/mod/modpost.h
===================================================================
--- linux-2.6.11-rc1-bk6.orig/scripts/mod/modpost.h
+++ linux-2.6.11-rc1-bk6/scripts/mod/modpost.h
@@ -53,8 +53,8 @@ static inline void __endian(const void *
 
 #endif
 
-#define NOFAIL(ptr)   do_nofail((ptr), __FILE__, __LINE__, #ptr)
-void *do_nofail(void *ptr, const char *file, int line, const char *expr);
+#define NOFAIL(ptr)   do_nofail((ptr), #ptr)
+void *do_nofail(void *ptr, const char *expr);
 
 struct buffer {
 	char *p;

--
Andreas Gruenbacher <agruen@suse.de>
SUSE Labs, SUSE LINUX PRODUCTS GMBH


  reply	other threads:[~2005-01-18 19:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-18 18:41 [kbuild 0/5] Some of our patches Andreas Gruenbacher
2005-01-18 18:41 ` Andreas Gruenbacher [this message]
2005-01-18 18:41 ` [kbuild 4/5] Include type information as module info where possible Andreas Gruenbacher
2005-01-19 16:14   ` Andreas Gruenbacher
2005-01-20 11:54     ` Andreas Gruenbacher
2005-01-30 15:56       ` Sam Ravnborg
2005-01-30 22:06         ` Andreas Gruenbacher
2005-01-30 22:19           ` Sam Ravnborg
2005-01-18 18:41 ` [kbuild 1/5] Warn when building external modules without modversions Andreas Gruenbacher
2005-01-18 18:41 ` [kbuild 3/5] Add cloneconfig target Andreas Gruenbacher
2005-01-18 18:41 ` [kbuild 2/5] Dont use the running kernels config file by default Andreas Gruenbacher
2005-01-18 20:15   ` Roman Zippel
2005-01-19 17:51     ` Andreas Gruenbacher
2005-01-19 18:18       ` Roman Zippel
2005-01-19 18:42         ` Andreas Gruenbacher
2005-01-19 19:27           ` Roman Zippel
2005-01-19 23:41           ` Gerd Knorr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050118192608.655088000.suse.de \
    --to=agruen@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®