GNU bug report logs - #20450
coreutils cannot built with clang

Previous Next

Package: coreutils;

Reported by: Yunlian Jiang <yunlian <at> chromium.org>

Date: Tue, 28 Apr 2015 19:46:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20450 in the body.
You can then email your comments to 20450 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#20450; Package coreutils. (Tue, 28 Apr 2015 19:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yunlian Jiang <yunlian <at> chromium.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 28 Apr 2015 19:46:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Yunlian Jiang <yunlian <at> chromium.org>
To: bug-coreutils <at> gnu.org
Subject: coreutils cannot built with clang
Date: Tue, 28 Apr 2015 12:38:53 -0700
[Message part 1 (text/plain, inline)]
Hi,

   When I try to use clang to build coreutils, I got some thing like

src/coreutils.c:81:3:   AR       src/libsinglebin_printenv.a
error: embedding a #include directive within macro arguments is not supported
# include "coreutils.h"
  ^

And I have the following ugly patch to make it work.

Thanks


---
 src/coreutils.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/coreutils.c b/src/coreutils.c
index 9f798b8..c46f0c7 100644
--- a/src/coreutils.c
+++ b/src/coreutils.c
@@ -70,15 +70,22 @@ Execute the PROGRAM_NAME built-in program with the
given PARAMETERS.\n\
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);

-      printf ("\n\
-Built-in programs:\n"
 #ifdef SINGLE_BINARY
 /* XXX: Ideally we#d like to present "install" here, not "ginstall".  */
+      const char * prog_list_name =
 # define SINGLE_BINARY_PROGRAM(prog_name_str, main_name) " " prog_name_str
 # include "coreutils.h"
 # undef SINGLE_BINARY_PROGRAM
+       ;
+#endif
+
+      printf ("\n\
+Built-in programs:\n");
+
+#ifdef SINGLE_BINARY
+      printf("%s", prog_list_name);
 #endif
-  "\n");
+      printf("\n");

       printf (_("\
 \n\
-- 
2.2.0.rc0.207.ga3a616c
[Message part 2 (text/html, inline)]

Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Tue, 28 Apr 2015 22:25:03 GMT) Full text and rfc822 format available.

Notification sent to Yunlian Jiang <yunlian <at> chromium.org>:
bug acknowledged by developer. (Tue, 28 Apr 2015 22:25:04 GMT) Full text and rfc822 format available.

Message #10 received at 20450-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Yunlian Jiang <yunlian <at> chromium.org>, 20450-done <at> debbugs.gnu.org
Subject: Re: bug#20450: coreutils cannot built with clang
Date: Tue, 28 Apr 2015 23:24:22 +0100
On 28/04/15 20:38, Yunlian Jiang wrote:
> Hi, 
> 
>    When I try to use clang to build coreutils, I got some thing like
> 
> src/coreutils.c:81:3:   AR       src/libsinglebin_printenv.a
> error: embedding a #include directive within macro arguments is not supported
> # include "coreutils.h"
>   ^
> 
> And I have the following ugly patch to make it work.

I can't reproduce with clang 3.5 on Fedora 22 here,
but yes this will be an issue anywhere printf is a macro.
I'll apply something like this fix in your name.

thanks!
Pádraig.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 27 May 2015 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 86 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.