use system rl headers, when --with-system-readline is provided
Commit Message
PR gdb/17077
Use system readline headers, instead the bundled ones, when gdb is
configured --with-system-readline
When building tui/tui-io.c one can see in gcc -E still the bundled
readline include files get used.
# 32 "./../opcodes/../readline/rltypedefs.h"
#define _FUNCTION_DEF
As the libreadline.{a,so} is linked from system it may lead to
incompatible ABI.
The provided patch:
-- makes use of the fact, that the preprocessor can differentiate
between #include "file" and #include <file>, when proceeding paths;
-- substitutes all occurrences of #include
"readline/{readline,history,tilde}.h" with #include
<readline/{readline,history,tilde}.h>;
-- enables the project root directory for includes (from opcode),
unconditionally only for #include "file", and for all includes ("",<>),
when the bundled readline is built (using -iquote in place of -I);
-- does not approach the problem for sim/erc32/sis.c.
Comments
Dilyan Palauzov <dilyan.palauzov@aegee.org> writes:
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index dfaa8a3..579d0dd 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -468,7 +468,7 @@ OPCODES = $(OPCODES_DIR)/libopcodes.a
> # versions?
> OP_INCLUDE = $(INCLUDE_DIR)/opcode
> # Some source files like to use #include "opcodes/file.h"
> -OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/..
> +OPCODES_CFLAGS = -I$(OP_INCLUDE) -iquote$(OPCODES_SRC)/..
-iquote is gcc-only.
Andreas.
Hello Andreas,
clang-3.6 t.c -Wp,--help
prints:
USAGE: clang -cc1 [options] <inputs>
OPTIONS:
-iquote <directory> Add directory to QUOTE include search path
[with t.c: #include <stdio.h>
int main (int argc, char** argv) {printf("abc\n"); return 0;}]
Greetings
Dilian
On 07/13/2015 11:29 AM, Andreas Schwab wrote:
> Dilyan Palauzov <dilyan.palauzov@aegee.org> writes:
>
>> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
>> index dfaa8a3..579d0dd 100644
>> --- a/gdb/Makefile.in
>> +++ b/gdb/Makefile.in
>> @@ -468,7 +468,7 @@ OPCODES = $(OPCODES_DIR)/libopcodes.a
>> # versions?
>> OP_INCLUDE = $(INCLUDE_DIR)/opcode
>> # Some source files like to use #include "opcodes/file.h"
>> -OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/..
>> +OPCODES_CFLAGS = -I$(OP_INCLUDE) -iquote$(OPCODES_SRC)/..
>
> -iquote is gcc-only.
>
> Andreas.
>
For the record, the -Wmissing-parameter-type and -Wold-style-declaration
from gdb/configure.ac are not supported by clang.
On 07/14/2015 03:21 PM, Dilyan Palauzov wrote:
> Hello Andreas,
>
> clang-3.6 t.c -Wp,--help
>
> prints:
>
> USAGE: clang -cc1 [options] <inputs>
>
> OPTIONS:
>
> -iquote <directory> Add directory to QUOTE include search path
>
> [with t.c: #include <stdio.h>
> int main (int argc, char** argv) {printf("abc\n"); return 0;}]
>
> Greetings
> Dilian
>
> On 07/13/2015 11:29 AM, Andreas Schwab wrote:
>> Dilyan Palauzov <dilyan.palauzov@aegee.org> writes:
>>
>>> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
>>> index dfaa8a3..579d0dd 100644
>>> --- a/gdb/Makefile.in
>>> +++ b/gdb/Makefile.in
>>> @@ -468,7 +468,7 @@ OPCODES = $(OPCODES_DIR)/libopcodes.a
>>> # versions?
>>> OP_INCLUDE = $(INCLUDE_DIR)/opcode
>>> # Some source files like to use #include "opcodes/file.h"
>>> -OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/..
>>> +OPCODES_CFLAGS = -I$(OP_INCLUDE) -iquote$(OPCODES_SRC)/..
>>
>> -iquote is gcc-only.
>>
>> Andreas.
>>
On 14 Jul 2015 15:21, Dilyan Palauzov wrote:
> Hello Andreas,
>
> clang-3.6 t.c -Wp,--help
>
> prints:
>
> USAGE: clang -cc1 [options] <inputs>
>
> OPTIONS:
>
> -iquote <directory> Add directory to QUOTE include search path
>
> [with t.c: #include <stdio.h>
> int main (int argc, char** argv) {printf("abc\n"); return 0;}]
are you going to verify every system/compiler for us ?
off hand, people routinely build on AIX too.
-mike
@@ -468,7 +468,7 @@ OPCODES = $(OPCODES_DIR)/libopcodes.a
# versions?
OP_INCLUDE = $(INCLUDE_DIR)/opcode
# Some source files like to use #include "opcodes/file.h"
-OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/..
+OPCODES_CFLAGS = -I$(OP_INCLUDE) -iquote$(OPCODES_SRC)/..
# The simulator is usually nonexistent; targets that include one
# should set this to list all the .o or .a files to be linked in.
@@ -33,7 +33,7 @@
#include "cli/cli-decode.h"
#include "cli/cli-setshow.h"
#include "gdb_vecs.h"
-#include "readline/tilde.h"
+#include <readline/tilde.h>
#include "completer.h"
#include "fnmatch.h"
#include "top.h"
@@ -69,8 +69,8 @@
#include "format.h"
/* readline include files */
-#include "readline/readline.h"
-#include "readline/history.h"
+#include <readline/readline.h>
+#include <readline/history.h>
/* readline defines this. */
#undef savestring
@@ -33,7 +33,7 @@
#include <nlist.h>
#endif
#include <paths.h>
-#include "readline/readline.h"
+#include <readline/readline.h>
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/user.h>
@@ -25,7 +25,7 @@
#include "cli-out.h"
#include "completer.h"
#include "vec.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
typedef struct cli_ui_out_data cli_out_data;
@@ -20,8 +20,8 @@
#include "defs.h"
#include "arch-utils.h"
#include "dyn-string.h"
-#include "readline/readline.h"
-#include "readline/tilde.h"
+#include <readline/readline.h>
+#include <readline/tilde.h>
#include "completer.h"
#include "target.h" /* For baud_rate, remote_debug and remote_timeout. */
#include "gdb_wait.h" /* For shell escape implementation. */
@@ -26,7 +26,7 @@
#include "completer.h"
#include <ctype.h>
#include "target.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#include "gdbcore.h"
#include "cli/cli-utils.h"
#include "gdb_bfd.h"
@@ -16,7 +16,7 @@
along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "readline/tilde.h"
+#include <readline/tilde.h>
#include "value.h"
#include <ctype.h>
#include "arch-utils.h"
b/gdb/compile/compile-object-load.c
@@ -23,7 +23,7 @@
#include "command.h"
#include "objfiles.h"
#include "gdbcore.h"
-#include "readline/tilde.h"
+#include <readline/tilde.h>
#include "bfdlink.h"
#include "gdbcmd.h"
#include "regcache.h"
@@ -36,7 +36,7 @@
/* Needed for rl_completer_word_break_characters() and for
rl_filename_completion_function. */
-#include "readline/readline.h"
+#include <readline/readline.h>
/* readline defines this. */
#undef savestring
@@ -37,7 +37,7 @@
#include "regset.h"
#include "symfile.h"
#include "exec.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#include "solib.h"
#include "filenames.h"
#include "progspace.h"
@@ -39,8 +39,8 @@
#include "maint.h"
/* readline include files. */
-#include "readline/readline.h"
-#include "readline/history.h"
+#include <readline/readline.h>
+#include <readline/history.h>
/* readline defines this. */
#undef savestring
@@ -37,7 +37,7 @@
#include "gcore.h"
#include <fcntl.h>
-#include "readline/readline.h"
+#include <readline/readline.h>
#include "gdbcore.h"
#include <ctype.h>
@@ -33,7 +33,7 @@
#include "regcache.h"
#include "regset.h"
#include "gdb_bfd.h"
-#include "readline/tilde.h"
+#include <readline/tilde.h>
/* The largest amount of memory to read from the target at once. We
must throttle it to limit the amount of memory used by GDB during
@@ -34,7 +34,7 @@
#include "continuations.h"
#include "arch-utils.h"
#include "target-descriptions.h"
-#include "readline/tilde.h"
+#include <readline/tilde.h>
void _initialize_inferiors (void);
@@ -23,7 +23,7 @@
#include "event-loop.h"
#include "gdb_select.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#include <windows.h>
@@ -53,7 +53,7 @@
#include "srec.h"
#include "regcache.h"
#include "gdbthread.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#include "rsp-low.h"
static char *dev_name;
@@ -29,7 +29,7 @@
#include "bcache.h"
#include "ui-out.h"
#include "command.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#include "gdb_regex.h"
#include "dictionary.h"
#include "language.h"
@@ -29,7 +29,7 @@
#include "language.h"
#include "event-loop.h"
#include "serial.h"
-#include "readline/tilde.h"
+#include <readline/tilde.h>
#include "python.h"
#include "extension-priv.h"
#include "cli/cli-utils.h"
@@ -38,7 +38,7 @@
#include "regcache.h"
#include "sim-regno.h"
#include "arch-utils.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#include "gdbthread.h"
/* Prototypes */
@@ -39,7 +39,7 @@
#include "exec.h"
#include "solist.h"
#include "observer.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#include "remote.h"
#include "solib.h"
#include "interps.h"
@@ -41,7 +41,7 @@
#include "filenames.h" /* for DOSish file names */
#include "completer.h"
#include "ui-out.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#define OPEN_MODE (O_RDONLY | O_BINARY)
#define FDOPEN_MODE FOPEN_RB
@@ -44,7 +44,7 @@
#include "completer.h"
#include "bcache.h"
#include "hashtab.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#include "block.h"
#include "observer.h"
#include "exec.h"
@@ -36,7 +36,7 @@
#include "typeprint.h"
#include "gdbcmd.h"
#include "source.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#include "psymtab.h"
@@ -51,8 +51,8 @@
#include "filenames.h"
/* readline include files. */
-#include "readline/readline.h"
-#include "readline/history.h"
+#include <readline/readline.h>
+#include <readline/history.h>
/* readline defines this. */
#undef savestring
@@ -19,7 +19,7 @@
#include "defs.h"
#include "tracefile.h"
-#include "readline/tilde.h"
+#include <readline/tilde.h>
#include "filestuff.h"
#include "rsp-low.h" /* bin2hex */
#include "regcache.h"
@@ -57,8 +57,8 @@
#include "tracefile.h"
/* readline include files */
-#include "readline/readline.h"
-#include "readline/history.h"
+#include <readline/readline.h>
+#include <readline/history.h>
/* readline defines this. */
#undef savestring
@@ -52,7 +52,7 @@
/* This redefines CTRL if it is not already defined, so it must come
after terminal state releated include files like <term.h> and
"gdb_curses.h". */
-#include "readline/readline.h"
+#include <readline/readline.h>
int tui_target_has_run = 0;
@@ -25,7 +25,7 @@
#include "ui-out.h"
#include "cli-out.h"
#include "tui/tui-data.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#include "tui/tui-win.h"
#include "tui/tui.h"
#include "tui/tui-io.h"
@@ -43,7 +43,7 @@
/* This redefines CTRL if it is not already defined, so it must come
after terminal state releated include files like <term.h> and
"gdb_curses.h". */
-#include "readline/readline.h"
+#include <readline/readline.h>
int
key_is_start_sequence (int ch)
@@ -48,7 +48,7 @@
#include "gdb_curses.h"
#include <ctype.h>
-#include "readline/readline.h"
+#include <readline/readline.h>
#include <signal.h>
@@ -53,7 +53,7 @@
/* This redefines CTRL if it is not already defined, so it must come
after terminal state releated include files like <term.h> and
"gdb_curses.h". */
-#include "readline/readline.h"
+#include <readline/readline.h>
/* Tells whether the TUI is active or not. */
int tui_active = 0;
@@ -60,7 +60,7 @@
#include "gdb_curses.h"
-#include "readline/readline.h"
+#include <readline/readline.h>
#include <sys/time.h>
#include <time.h>