public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing)
@ 2014-10-22 7:39 dmalcolm at gcc dot gnu.org
2014-10-22 7:40 ` [Bug c/63613] " pinskia at gcc dot gnu.org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2014-10-22 7:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
Bug ID: 63613
Summary: Regression: Unable to link .c file using <dejagnu.h>
API (inline functions not appearing)
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: dmalcolm at gcc dot gnu.org
Created attachment 33777
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33777&action=edit
Preprocessed reproducer
I'm no longer able to build test programs that use the <dejagnu.h>
header, due to a linker failure.
$ cat ../../test-dg-api.c
#include <dejagnu.h>
int
main (int argc, char **argv)
{
pass ("got here");
return 0;
}
The dejagnu.h API consists purely of functions marked "inline" e.g.:
63 inline void
64 pass (const char* fmt, ...)
65 {
66 va_list ap;
67
68 passed++;
69 va_start (ap, fmt);
70 vsnprintf (buffer, sizeof (buffer), fmt, ap);
71 va_end (ap);
72 printf ("\tPASSED: %s\n", buffer);
73 wait ();
74 }
See http://git.savannah.gnu.org/cgit/dejagnu.git/tree/dejagnu.h
With gcc 4.8.3:
$ gcc ../../test-dg-api.c -o test-dg-api
$ ./test-dg-api
PASSED: got here
and examination of the generated assembler shows it contains an
implementation of e.g. "pass".
With trunk:
$ ./xgcc -B. ../../test-dg-api.c -o test-dg-api
/tmp/ccc7PdfM.o: In function `main':
test-dg-api.c:(.text+0x21): undefined reference to `pass'
collect2: error: ld returned 1 exit status
and the generated asm doesn't contain an implementation of "pass".
This is with r216530. I believe the problem appears somewhere between
r215958: WORKS (aka e012cdc775868e9922f5fef9068a764546876d93, 2014-10-06)
and
r216524: ERROR (aka d14cac46135326115f0dc589b0b3d2d249d74cf7, 2014-10-21)
Am attempting to isolate further.
With -v -save-temps:
$ ./xgcc -B. -v -save-temps ../../test-dg-api.c -o test-dg-api
command line of cc1 is:
./cc1 -fpreprocessed test-dg-api.i -quiet -dumpbase test-dg-api.c
-mtune=generic -march=x86-64 -auxbase test-dg-api -version -o test-dg-api.s
and link line:
./collect2 -plugin ./liblto_plugin.so -plugin-opt=./lto-wrapper
-plugin-opt=-fresolution=test-dg-api.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
--eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o
test-dg-api /lib/../lib64/crt1.o /lib/../lib64/crti.o ./crtbegin.o -L.
-L/lib/../lib64 -L/usr/lib/../lib64 test-dg-api.o -lgcc --as-needed -lgcc_s
--no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed ./crtend.o
/lib/../lib64/crtn.o
Will attach the test-dg-api.i
This is with build,host,target==x86_64-unknown-linux-gnu (Fedora 20 x86_64)
This affects merger of my jit branch, since my testsuite is based on
dejagnu.h.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/63613] Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing)
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
@ 2014-10-22 7:40 ` pinskia at gcc dot gnu.org
2014-10-22 7:45 ` jakub at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-10-22 7:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
C11 inline semantics vs gnu89 ones. Not a gcc bug. A fix includes is needed.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/63613] Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing)
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
2014-10-22 7:40 ` [Bug c/63613] " pinskia at gcc dot gnu.org
@ 2014-10-22 7:45 ` jakub at gcc dot gnu.org
2014-10-22 8:22 ` dmalcolm at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-10-22 7:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That means dejagnu.h assumes the GNU inline semantics, but doesn't use
__gnu_inline__ attribute. So, either compile with -fgnu89-inline, or get
dejagnu.h fixed.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/63613] Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing)
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
2014-10-22 7:40 ` [Bug c/63613] " pinskia at gcc dot gnu.org
2014-10-22 7:45 ` jakub at gcc dot gnu.org
@ 2014-10-22 8:22 ` dmalcolm at gcc dot gnu.org
2014-10-22 8:24 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2014-10-22 8:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
--- Comment #3 from dmalcolm at gcc dot gnu.org ---
Aha. Thanks.
Indeed, "git bisect" just confirmed that r216247 is the first commit in which
my testcase stops working:
commit b2601928b5bf34a817b5a9a2a371c476018e634d
Author: mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed Oct 15 10:08:00 2014 +0000
* doc/invoke.texi: Update to reflect that GNU11 is the default
mode for C.
* c-common.h (c_language_kind): Update comment.
c-family/
* c-opts.c (c_common_init_options): Make -std=gnu11 the default for C.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216247
138bc75d-0d04-0410-961f-82ee72b054a4
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/63613] Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing)
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
` (2 preceding siblings ...)
2014-10-22 8:22 ` dmalcolm at gcc dot gnu.org
@ 2014-10-22 8:24 ` rguenth at gcc dot gnu.org
2014-10-22 13:52 ` dmalcolm at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-10-22 8:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Invalid.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/63613] Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing)
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
` (3 preceding siblings ...)
2014-10-22 8:24 ` rguenth at gcc dot gnu.org
@ 2014-10-22 13:52 ` dmalcolm at gcc dot gnu.org
2014-10-22 15:24 ` [Bug other/63613] " pinskia at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2014-10-22 13:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
--- Comment #5 from dmalcolm at gcc dot gnu.org ---
FWIW I've reported this on the DejaGnu mailing list here:
http://lists.gnu.org/archive/html/dejagnu/2014-10/msg00011.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug other/63613] Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing)
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
` (4 preceding siblings ...)
2014-10-22 13:52 ` dmalcolm at gcc dot gnu.org
@ 2014-10-22 15:24 ` pinskia at gcc dot gnu.org
2014-10-22 15:38 ` [Bug other/63613] dejagnu.h needs to be fix included dmalcolm at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-10-22 15:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |NEW
Last reconfirmed| |2014-10-22
Component|c |other
Resolution|INVALID |---
Ever confirmed|0 |1
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Let's keep this open for a fix includes solution.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug other/63613] dejagnu.h needs to be fix included
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
` (5 preceding siblings ...)
2014-10-22 15:24 ` [Bug other/63613] " pinskia at gcc dot gnu.org
@ 2014-10-22 15:38 ` dmalcolm at gcc dot gnu.org
2014-10-22 15:55 ` dmalcolm at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2014-10-22 15:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
--- Comment #7 from dmalcolm at gcc dot gnu.org ---
(In reply to Andrew Pinski from comment #6)
> Let's keep this open for a fix includes solution.
Does anything in gcc's bootstrap or testsuite actually use dejagnu.h? (other
than my jit.exp on the jit branch, and I've fixed that now by adding
-fgnu89-inline)
It seems to be that this is more an issue for both:
(A) DejaGnu upstream (where I've reported it), and
(B) GCC release notes, for some kind of 5.0 porting guide (i.e.
"what does an end-user need to know about the gnu11 change?")
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug other/63613] dejagnu.h needs to be fix included
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
` (6 preceding siblings ...)
2014-10-22 15:38 ` [Bug other/63613] dejagnu.h needs to be fix included dmalcolm at gcc dot gnu.org
@ 2014-10-22 15:55 ` dmalcolm at gcc dot gnu.org
2014-10-22 15:57 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2014-10-22 15:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
--- Comment #8 from dmalcolm at gcc dot gnu.org ---
(In reply to dmalcolm from comment #7)
[...]
> (B) GCC release notes, for some kind of 5.0 porting guide (i.e.
> "what does an end-user need to know about the gnu11 change?")
...and I see that Marek just posted just such a thing :)
https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02268.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug other/63613] dejagnu.h needs to be fix included
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
` (7 preceding siblings ...)
2014-10-22 15:55 ` dmalcolm at gcc dot gnu.org
@ 2014-10-22 15:57 ` pinskia at gcc dot gnu.org
2014-12-04 2:36 ` dmalcolm at gcc dot gnu.org
2014-12-04 22:12 ` dmalcolm at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-10-22 15:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to dmalcolm from comment #7)
> (In reply to Andrew Pinski from comment #6)
> > Let's keep this open for a fix includes solution.
>
> Does anything in gcc's bootstrap or testsuite actually use dejagnu.h? (other
> than my jit.exp on the jit branch, and I've fixed that now by adding
> -fgnu89-inline)
Nothing I know of but that does not mean we want to make dejagnu.h work for C11
even without -fgnu89-inline.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug other/63613] dejagnu.h needs to be fix included
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
` (8 preceding siblings ...)
2014-10-22 15:57 ` pinskia at gcc dot gnu.org
@ 2014-12-04 2:36 ` dmalcolm at gcc dot gnu.org
2014-12-04 22:12 ` dmalcolm at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2014-12-04 2:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
David Malcolm <dmalcolm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |dmalcolm at gcc dot gnu.org
--- Comment #10 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Assigning to myself; I have a patch in the works for this to fixup dejagnu.h
via fixincludes.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug other/63613] dejagnu.h needs to be fix included
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
` (9 preceding siblings ...)
2014-12-04 2:36 ` dmalcolm at gcc dot gnu.org
@ 2014-12-04 22:12 ` dmalcolm at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2014-12-04 22:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63613
--- Comment #11 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Patch posted as https://gcc.gnu.org/ml/gcc-patches/2014-12/msg00468.html
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2014-12-04 22:12 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-22 7:39 [Bug c/63613] New: Regression: Unable to link .c file using <dejagnu.h> API (inline functions not appearing) dmalcolm at gcc dot gnu.org
2014-10-22 7:40 ` [Bug c/63613] " pinskia at gcc dot gnu.org
2014-10-22 7:45 ` jakub at gcc dot gnu.org
2014-10-22 8:22 ` dmalcolm at gcc dot gnu.org
2014-10-22 8:24 ` rguenth at gcc dot gnu.org
2014-10-22 13:52 ` dmalcolm at gcc dot gnu.org
2014-10-22 15:24 ` [Bug other/63613] " pinskia at gcc dot gnu.org
2014-10-22 15:38 ` [Bug other/63613] dejagnu.h needs to be fix included dmalcolm at gcc dot gnu.org
2014-10-22 15:55 ` dmalcolm at gcc dot gnu.org
2014-10-22 15:57 ` pinskia at gcc dot gnu.org
2014-12-04 2:36 ` dmalcolm at gcc dot gnu.org
2014-12-04 22:12 ` dmalcolm at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).