public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 2/2] darwin: Add fork-inferior.o to NATDEPFILES
  2017-06-10 18:28 [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES Simon Marchi
@ 2017-06-10 18:28 ` Simon Marchi
  2017-06-10 21:07 ` [PATCH 3/2] darwin-nat: Add missing include Simon Marchi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Simon Marchi @ 2017-06-10 18:28 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

I happened to be build-testing on macOS and found this:

  Undefined symbols for architecture x86_64:

    "fork_inferior(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char**, void (*)(), void (*)(int), void (*)(), char const*, void (*)(char const*, char* const*, char* const*))", referenced from:

        darwin_create_inferior(target_ops*, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char**, int) in darwin-nat.o

    "startup_inferior(int, int, target_waitstatus*, ptid_t*)", referenced from:

        gdb_startup_inferior(int, int) in fork-child.o

    "trace_start_error(char const*, ...)", referenced from:

        darwin_ptrace_me() in darwin-nat.o

    "trace_start_error_with_name(char const*)", referenced from:

        darwin_ptrace_me() in darwin-nat.o

  ld: symbol(s) not found for architecture x86_64

  clang: error: linker command failed with exit code 1 (use -v to see invocation)

Adding fork-inferior.o fixes it.  I factored out the Darwin bits that
are no architecture-specific in the section meant for that at the top.

I only built-tested this using Travis-CI, since I don't have access to
this platform.

gdb/ChangeLog:

	* configure.nat: Factor out Darwin bits that are not
	architecture-specific.  Add fork-inferior.o.
---
 gdb/configure.nat | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gdb/configure.nat b/gdb/configure.nat
index b9b9a40..2026ee7 100644
--- a/gdb/configure.nat
+++ b/gdb/configure.nat
@@ -81,6 +81,10 @@ case ${gdb_host} in
     aix)
 	NATDEPFILES='fork-inferior.o fork-child.o inf-ptrace.o'
 	;;
+    darwin)
+	NATDEPFILES='fork-child.o fork-inferior.o darwin-nat.o \
+	    darwin-nat-info.o'
+        ;;
 esac
 
 # This is where we actually filter by host and host CPU.
@@ -133,9 +137,8 @@ case ${gdb_host} in
 	case ${gdb_host_cpu} in
 	    i386)
 		# Host: IA86 running Darwin
-		NATDEPFILES='fork-child.o darwin-nat.o \
-		i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o \
-		darwin-nat-info.o'
+		NATDEPFILES="${NATDEPFILES} i386-darwin-nat.o x86-nat.o \
+		    x86-dregs.o amd64-nat.o"
 		;;
 	esac
 	;;
-- 
2.7.4

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

* [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES
@ 2017-06-10 18:28 Simon Marchi
  2017-06-10 18:28 ` [PATCH 2/2] darwin: " Simon Marchi
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Simon Marchi @ 2017-06-10 18:28 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Trying to build on AIX gives:

ld: 0711-317 ERROR: Undefined symbol: .trace_start_error_with_name(char const*)
ld: 0711-317 ERROR: Undefined symbol: .fork_inferior(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char**, void (*)(), void (*)(int), void (*)(), char const*, void (*)(char const*, char* const*, char* const*))
ld: 0711-317 ERROR: Undefined symbol: .startup_inferior(int, int, target_waitstatus*, ptid_t*)

Including fork-inferior.o in the build should help.  I also factored out
the AIX bits that are not architecture-specific to be consistent with the other
OSes.

gdb/ChangeLog:

	* configure.nat: Factor out AIX bits that are not
	architecture-specific.  Add fork-inferior.o.
---
 gdb/configure.nat | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/configure.nat b/gdb/configure.nat
index e6da599..b9b9a40 100644
--- a/gdb/configure.nat
+++ b/gdb/configure.nat
@@ -78,6 +78,9 @@ case ${gdb_host} in
     mingw*)
 	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o'
 	;;
+    aix)
+	NATDEPFILES='fork-inferior.o fork-child.o inf-ptrace.o'
+	;;
 esac
 
 # This is where we actually filter by host and host CPU.
@@ -88,7 +91,7 @@ case ${gdb_host} in
 		# Host: IBM PowerPC running AIX aix-thread.o is not
 		# listed in NATDEPFILES as it is pulled in by
 		# configure.
-		NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
+		NATDEPFILES="${NATDEPFILES} rs6000-nat.o"
 
 		# When compiled with cc, for debugging, this argument
 		# should be passed.  We have no idea who our current
-- 
2.7.4

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

* [PATCH 3/2] darwin-nat: Add missing include
  2017-06-10 18:28 [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES Simon Marchi
  2017-06-10 18:28 ` [PATCH 2/2] darwin: " Simon Marchi
@ 2017-06-10 21:07 ` Simon Marchi
  2017-06-13 11:12 ` [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES Pedro Alves
  2017-06-13 12:08 ` Nitish Kumar Mishra
  3 siblings, 0 replies; 6+ messages in thread
From: Simon Marchi @ 2017-06-10 21:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

I forgot this one, which is kind of related.

The function trace_start_error_with_name has moved in commit "Share
fork_inferior et al with gdbserver", so this additional include is
needed.

Fixes:

darwin-nat.c:1735:5: error: use of undeclared identifier 'trace_start_error_with_name'
    trace_start_error_with_name ("close");

gdb/ChangeLog:

	* darwin-nat.c: Include "nat/fork-inferior.h".
---
 gdb/darwin-nat.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 4330a60..cd67249 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -63,6 +63,7 @@
 
 #include "darwin-nat.h"
 #include "common/filestuff.h"
+#include "nat/fork-inferior.h"
 
 /* Quick overview.
    Darwin kernel is Mach + BSD derived kernel.  Note that they share the
-- 
2.7.4

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

* Re: [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES
  2017-06-10 18:28 [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES Simon Marchi
  2017-06-10 18:28 ` [PATCH 2/2] darwin: " Simon Marchi
  2017-06-10 21:07 ` [PATCH 3/2] darwin-nat: Add missing include Simon Marchi
@ 2017-06-13 11:12 ` Pedro Alves
  2017-06-13 12:08 ` Nitish Kumar Mishra
  3 siblings, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2017-06-13 11:12 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 06/10/2017 07:27 PM, Simon Marchi wrote:
> Trying to build on AIX gives:
> 
> ld: 0711-317 ERROR: Undefined symbol: .trace_start_error_with_name(char const*)
> ld: 0711-317 ERROR: Undefined symbol: .fork_inferior(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char**, void (*)(), void (*)(int), void (*)(), char const*, void (*)(char const*, char* const*, char* const*))
> ld: 0711-317 ERROR: Undefined symbol: .startup_inferior(int, int, target_waitstatus*, ptid_t*)
> 
> Including fork-inferior.o in the build should help.  I also factored out
> the AIX bits that are not architecture-specific to be consistent with the other
> OSes.

OK, and obvious, IMO.  Every port that builds fork-child.c must
also build nat/fork-inferior.c.

The other patches look good too.

Thanks,
Pedro Alves

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

* Re: [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES
  2017-06-10 18:28 [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES Simon Marchi
                   ` (2 preceding siblings ...)
  2017-06-13 11:12 ` [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES Pedro Alves
@ 2017-06-13 12:08 ` Nitish Kumar Mishra
  2017-06-13 19:38   ` Simon Marchi
  3 siblings, 1 reply; 6+ messages in thread
From: Nitish Kumar Mishra @ 2017-06-13 12:08 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches, sangamesh.swamy

Hi Simon !

I and Sangamesh (in cc) have tested this patch in AIX environment and
it is working fine without any issue.

Thanks,
Nitish

On Sat, Jun 10, 2017 at 11:57 PM, Simon Marchi
<simon.marchi@ericsson.com> wrote:
> Trying to build on AIX gives:
>
> ld: 0711-317 ERROR: Undefined symbol: .trace_start_error_with_name(char const*)
> ld: 0711-317 ERROR: Undefined symbol: .fork_inferior(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char**, void (*)(), void (*)(int), void (*)(), char const*, void (*)(char const*, char* const*, char* const*))
> ld: 0711-317 ERROR: Undefined symbol: .startup_inferior(int, int, target_waitstatus*, ptid_t*)
>
> Including fork-inferior.o in the build should help.  I also factored out
> the AIX bits that are not architecture-specific to be consistent with the other
> OSes.
>
> gdb/ChangeLog:
>
>         * configure.nat: Factor out AIX bits that are not
>         architecture-specific.  Add fork-inferior.o.
> ---
>  gdb/configure.nat | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/configure.nat b/gdb/configure.nat
> index e6da599..b9b9a40 100644
> --- a/gdb/configure.nat
> +++ b/gdb/configure.nat
> @@ -78,6 +78,9 @@ case ${gdb_host} in
>      mingw*)
>         NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o'
>         ;;
> +    aix)
> +       NATDEPFILES='fork-inferior.o fork-child.o inf-ptrace.o'
> +       ;;
>  esac
>
>  # This is where we actually filter by host and host CPU.
> @@ -88,7 +91,7 @@ case ${gdb_host} in
>                 # Host: IBM PowerPC running AIX aix-thread.o is not
>                 # listed in NATDEPFILES as it is pulled in by
>                 # configure.
> -               NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
> +               NATDEPFILES="${NATDEPFILES} rs6000-nat.o"
>
>                 # When compiled with cc, for debugging, this argument
>                 # should be passed.  We have no idea who our current
> --
> 2.7.4
>

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

* Re: [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES
  2017-06-13 12:08 ` Nitish Kumar Mishra
@ 2017-06-13 19:38   ` Simon Marchi
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Marchi @ 2017-06-13 19:38 UTC (permalink / raw)
  To: Nitish Kumar Mishra; +Cc: Simon Marchi, gdb-patches, sangamesh.swamy

On 2017-06-13 14:08, Nitish Kumar Mishra wrote:
> Hi Simon !
> 
> I and Sangamesh (in cc) have tested this patch in AIX environment and
> it is working fine without any issue.
> 
> Thanks,
> Nitish

Thanks, this is now pushed.

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

end of thread, other threads:[~2017-06-13 19:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-10 18:28 [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES Simon Marchi
2017-06-10 18:28 ` [PATCH 2/2] darwin: " Simon Marchi
2017-06-10 21:07 ` [PATCH 3/2] darwin-nat: Add missing include Simon Marchi
2017-06-13 11:12 ` [PATCH 1/2] aix: Add fork-inferior.o to NATDEPFILES Pedro Alves
2017-06-13 12:08 ` Nitish Kumar Mishra
2017-06-13 19:38   ` Simon Marchi

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).