public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH] For broken exception handling in GDB on AIX platform
@ 2017-03-27  4:56 David Edelsohn
  2017-03-29 19:31 ` Jeff Law
  0 siblings, 1 reply; 11+ messages in thread
From: David Edelsohn @ 2017-03-27  4:56 UTC (permalink / raw)
  To: GCC Patches; +Cc: Joel Brobecker, Nitish Kumar Mishra, Paolo Bonzini

Nitish works for IBM and I can stand in as the contributor.  The patch
would be very helpful to work around an AIX exception handling
problem.

Because the patch is a generic option and not target-specific, it
needs a build machinery maintainer or Global Reviewer to approve.

Thanks, David

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

* Re: [PATCH] For broken exception handling in GDB on AIX platform
  2017-03-27  4:56 [PATCH] For broken exception handling in GDB on AIX platform David Edelsohn
@ 2017-03-29 19:31 ` Jeff Law
  0 siblings, 0 replies; 11+ messages in thread
From: Jeff Law @ 2017-03-29 19:31 UTC (permalink / raw)
  To: David Edelsohn, GCC Patches
  Cc: Joel Brobecker, Nitish Kumar Mishra, Paolo Bonzini

On 03/26/2017 06:54 PM, David Edelsohn wrote:
> Nitish works for IBM and I can stand in as the contributor.  The patch
> would be very helpful to work around an AIX exception handling
> problem.
>
> Because the patch is a generic option and not target-specific, it
> needs a build machinery maintainer or Global Reviewer to approve.
Thanks.  I totally missed it when it went by.  Probably because it had 
GDB in the subject line :-)  Found a copy of the thread and put it into 
my queue.

jeff

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

* [PATCH] For broken exception handling in GDB on AIX platform
@ 2017-04-25  7:31 Sangamesh Mallayya
  0 siblings, 0 replies; 11+ messages in thread
From: Sangamesh Mallayya @ 2017-04-25  7:31 UTC (permalink / raw)
  To: gcc-patches; +Cc: Nitish Mishra

Hi,

I work with nitish.
Just wanted to check on this patch contribution if anyone has comments yet 
or changes are fine.  As of now all the comments are answered. 

Here is link https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00121.html

Thanks,
-Sangamesh


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

* Re: [PATCH] For broken exception handling in GDB on AIX platform
  2017-03-29 19:42   ` Jeff Law
@ 2017-04-04  7:39     ` Nitish Kumar Mishra
  0 siblings, 0 replies; 11+ messages in thread
From: Nitish Kumar Mishra @ 2017-04-04  7:39 UTC (permalink / raw)
  To: Jeff Law; +Cc: Joel Brobecker, gcc-patches

Hi Jeff,

Our AIX team is parallely working on the issue that why EH is not
working with static linking on AIX. For time being this patch
will be work around for the issue.


On Thu, Mar 30, 2017 at 1:07 AM, Jeff Law <law@redhat.com> wrote:
> On 03/26/2017 06:05 PM, Joel Brobecker wrote:
>>
>> Hello,
>>
>>> I got some review comment from Bernhard Reutner-Fischer, and I have
>>> updated the patch accordingly.
>>> This patch is for bug opened
>>> here:https://sourceware.org/bugzilla/show_bug.cgi?id=21187
>>
>>
>> This patch has been identified as one of the desirable patches
>> to have for the GDB 8.0 release, for which we are hoping to create
>> the branch ASAP. Without this patch, it would be difficult for
>> users on AIX to build a functional debugger.
>>
>> Would it be possible to help Nitish through the review and approval
>> process?
>>
>> Here is a ChangeLog entry:
>>
>>         * configure.ac: Add support for --disable-staticlib.
>>         * configure: Regenerate.
>>
>> Can someone review the patch, please?
>
> Isn't this just papering over the problem by just disabling static linking
> rather than digging into why EH is not working with static linking on AIX?
>
> It'd be different if there was some fundamental reason why EH could not work
> with static linking on AIX.
>
> Am I missing something?
>
> Jeff
>

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

* Re: [PATCH] For broken exception handling in GDB on AIX platform
  2017-03-27  0:54 ` Joel Brobecker
@ 2017-03-29 19:42   ` Jeff Law
  2017-04-04  7:39     ` Nitish Kumar Mishra
  0 siblings, 1 reply; 11+ messages in thread
From: Jeff Law @ 2017-03-29 19:42 UTC (permalink / raw)
  To: Joel Brobecker, Nitish Kumar Mishra; +Cc: gcc-patches

On 03/26/2017 06:05 PM, Joel Brobecker wrote:
> Hello,
>
>> I got some review comment from Bernhard Reutner-Fischer, and I have
>> updated the patch accordingly.
>> This patch is for bug opened
>> here:https://sourceware.org/bugzilla/show_bug.cgi?id=21187
>
> This patch has been identified as one of the desirable patches
> to have for the GDB 8.0 release, for which we are hoping to create
> the branch ASAP. Without this patch, it would be difficult for
> users on AIX to build a functional debugger.
>
> Would it be possible to help Nitish through the review and approval
> process?
>
> Here is a ChangeLog entry:
>
>         * configure.ac: Add support for --disable-staticlib.
>         * configure: Regenerate.
>
> Can someone review the patch, please?
Isn't this just papering over the problem by just disabling static 
linking rather than digging into why EH is not working with static 
linking on AIX?

It'd be different if there was some fundamental reason why EH could not 
work with static linking on AIX.

Am I missing something?

Jeff

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

* Re: [PATCH] For broken exception handling in GDB on AIX platform
  2017-03-08  9:27 Nitish Kumar Mishra
@ 2017-03-27  0:54 ` Joel Brobecker
  2017-03-29 19:42   ` Jeff Law
  0 siblings, 1 reply; 11+ messages in thread
From: Joel Brobecker @ 2017-03-27  0:54 UTC (permalink / raw)
  To: Nitish Kumar Mishra; +Cc: gcc-patches

Hello,

> I got some review comment from Bernhard Reutner-Fischer, and I have
> updated the patch accordingly.
> This patch is for bug opened
> here:https://sourceware.org/bugzilla/show_bug.cgi?id=21187

This patch has been identified as one of the desirable patches
to have for the GDB 8.0 release, for which we are hoping to create
the branch ASAP. Without this patch, it would be difficult for
users on AIX to build a functional debugger.

Would it be possible to help Nitish through the review and approval
process?

Here is a ChangeLog entry:

        * configure.ac: Add support for --disable-staticlib.
        * configure: Regenerate.

Can someone review the patch, please?

Thank you!


> 
> Please find the attachment below.
> 
> Thanks and Regards,
> Nitish K Mishra.

> diff --git a/configure.ac b/configure.ac
> index 3ec86c1..c400251 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -471,6 +471,13 @@ ENABLE_LIBSTDCXX=default)
>    noconfigdirs="$noconfigdirs target-libstdc++-v3"
>  fi]
>  
> +AC_ARG_ENABLE(staticlib,
> +AS_HELP_STRING([--disable-staticlib],
> +  [do not link libstdc++ and libgcc library statically, default is static linking]),
> +ENABLE_STATICLIB=$enableval,
> +ENABLE_STATICLIB=yes)
> +
> +
>  # If this is accelerator compiler and its target is intelmic we enable
>  # target liboffloadmic by default.  If this is compiler with offloading
>  # for intelmic we enable host liboffloadmic by default.  Otherwise
> @@ -1406,9 +1413,10 @@ if test -z "$LD"; then
>    fi
>  fi
>  
> -# Check whether -static-libstdc++ -static-libgcc is supported.
> +# If ENABLE_STATICLIB is set for configuration, check whether -static-libstdc++ -static-libgcc is supported
>  have_static_libs=no
> -if test "$GCC" = yes; then
> +if test "$ENABLE_STATICLIB" = yes; then
> + if test "$GCC" = yes; then
>    saved_LDFLAGS="$LDFLAGS"
>  
>    LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
> @@ -1424,6 +1432,7 @@ int main() {}],
>    AC_LANG_POP(C++)
>  
>    LDFLAGS="$saved_LDFLAGS"
> + fi
>  fi
>  
>  ACX_PROG_GNAT
> @@ -1741,6 +1750,9 @@ AC_ARG_WITH(stage1-ldflags,
>   # trust that they are doing what they want.
>   if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
>     stage1_ldflags="-static-libstdc++ -static-libgcc"
> +   else
> +  # If static lib is disabled.
> +   stage1_ldflags=""
>   fi])
>  AC_SUBST(stage1_ldflags)
>  
> @@ -1768,8 +1780,11 @@ AC_ARG_WITH(boot-ldflags,
>   # In stages 2 and 3, default to linking libstdc++ and libgcc
>   # statically.  But if the user explicitly specified the libraries to
>   # use, trust that they are doing what they want.
> - if test "$poststage1_libs" = ""; then
> + if test "$poststage1_libs" = "" -a "$have_static_libs" = yes; then
>     poststage1_ldflags="-static-libstdc++ -static-libgcc"
> +   else
> +   # If static library linking is disabled.
> +   poststage1_ldflags=""
>   fi])
>  AC_SUBST(poststage1_ldflags)
>  


-- 
Joel

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

* [PATCH] For broken exception handling in GDB on AIX platform
@ 2017-03-08  9:27 Nitish Kumar Mishra
  2017-03-27  0:54 ` Joel Brobecker
  0 siblings, 1 reply; 11+ messages in thread
From: Nitish Kumar Mishra @ 2017-03-08  9:27 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 265 bytes --]

Hi,

I got some review comment from Bernhard Reutner-Fischer, and I have
updated the patch accordingly.
This patch is for bug opened
here:https://sourceware.org/bugzilla/show_bug.cgi?id=21187

Please find the attachment below.

Thanks and Regards,
Nitish K Mishra.

[-- Attachment #2: disable_static_linking.patch --]
[-- Type: text/x-patch, Size: 2018 bytes --]

diff --git a/configure.ac b/configure.ac
index 3ec86c1..c400251 100644
--- a/configure.ac
+++ b/configure.ac
@@ -471,6 +471,13 @@ ENABLE_LIBSTDCXX=default)
   noconfigdirs="$noconfigdirs target-libstdc++-v3"
 fi]
 
+AC_ARG_ENABLE(staticlib,
+AS_HELP_STRING([--disable-staticlib],
+  [do not link libstdc++ and libgcc library statically, default is static linking]),
+ENABLE_STATICLIB=$enableval,
+ENABLE_STATICLIB=yes)
+
+
 # If this is accelerator compiler and its target is intelmic we enable
 # target liboffloadmic by default.  If this is compiler with offloading
 # for intelmic we enable host liboffloadmic by default.  Otherwise
@@ -1406,9 +1413,10 @@ if test -z "$LD"; then
   fi
 fi
 
-# Check whether -static-libstdc++ -static-libgcc is supported.
+# If ENABLE_STATICLIB is set for configuration, check whether -static-libstdc++ -static-libgcc is supported
 have_static_libs=no
-if test "$GCC" = yes; then
+if test "$ENABLE_STATICLIB" = yes; then
+ if test "$GCC" = yes; then
   saved_LDFLAGS="$LDFLAGS"
 
   LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
@@ -1424,6 +1432,7 @@ int main() {}],
   AC_LANG_POP(C++)
 
   LDFLAGS="$saved_LDFLAGS"
+ fi
 fi
 
 ACX_PROG_GNAT
@@ -1741,6 +1750,9 @@ AC_ARG_WITH(stage1-ldflags,
  # trust that they are doing what they want.
  if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
    stage1_ldflags="-static-libstdc++ -static-libgcc"
+   else
+  # If static lib is disabled.
+   stage1_ldflags=""
  fi])
 AC_SUBST(stage1_ldflags)
 
@@ -1768,8 +1780,11 @@ AC_ARG_WITH(boot-ldflags,
  # In stages 2 and 3, default to linking libstdc++ and libgcc
  # statically.  But if the user explicitly specified the libraries to
  # use, trust that they are doing what they want.
- if test "$poststage1_libs" = ""; then
+ if test "$poststage1_libs" = "" -a "$have_static_libs" = yes; then
    poststage1_ldflags="-static-libstdc++ -static-libgcc"
+   else
+   # If static library linking is disabled.
+   poststage1_ldflags=""
  fi])
 AC_SUBST(poststage1_ldflags)
 

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

* Re: [PATCH] For broken exception handling in GDB on AIX platform
  2017-03-07 12:43   ` Nitish Kumar Mishra
@ 2017-03-07 22:42     ` Bernhard Reutner-Fischer
  0 siblings, 0 replies; 11+ messages in thread
From: Bernhard Reutner-Fischer @ 2017-03-07 22:42 UTC (permalink / raw)
  To: gcc-patches, Nitish Kumar Mishra

On 7 March 2017 13:43:00 CET, Nitish Kumar Mishra <mishra.nitish.88@gmail.com> wrote:
>Hi,
>
>I have update the patch according to some comments from GDB community.
>Please find the attachments.

If it is AIX specific, you probably should not remove fuchsia support.
And since we most likely do not link host_tools statically into AIX toolchain binaries, I suggest you don't remove texinfo too.

thanks,

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

* Re: [PATCH] For broken exception handling in GDB on AIX platform
  2017-03-01  8:03 ` Nitish Kumar Mishra
@ 2017-03-07 12:43   ` Nitish Kumar Mishra
  2017-03-07 22:42     ` Bernhard Reutner-Fischer
  0 siblings, 1 reply; 11+ messages in thread
From: Nitish Kumar Mishra @ 2017-03-07 12:43 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 2416 bytes --]

Hi,

I have update the patch according to some comments from GDB community.
Please find the attachments.

Thanks and Regards,
Nitish K Mishra

On Wed, Mar 1, 2017 at 1:33 PM, Nitish Kumar Mishra
<mishra.nitish.88@gmail.com> wrote:
> Hi,
> I have opened a defect for the same here:
> https://sourceware.org/bugzilla/show_bug.cgi?id=21187
>
> Thanks and Regards,
> Nitish K Mishra
>
> On Wed, Mar 1, 2017 at 1:25 PM, Nitish Kumar Mishra
> <mishra.nitish.88@gmail.com> wrote:
>> Hi,
>> The patch is for the broken exception handling in GDB on AIX platform.
>> When linked statically with libstdc++ and libgcc on AIX platform, GDB
>> is facing broken exception handling issues.
>> Following is the error output when GDB is linked statically with
>> mentioned libraries: (GDB-7.12.1, built with GCC-6.2, 64 bit mode, AIX
>> platform):
>>
>> # ./gdb
>> GNU gdb (GDB) 7.12.1
>> Copyright (C) 2017 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
>> and "show warranty" for details.
>> This GDB was configured as "powerpc64-ibm-aix7.2.0.0".
>> Type "show configuration" for configuration details.
>> For bug reporting instructions, please see:
>> <http://www.gnu.org/software/gdb/bugs/>.
>> Find the GDB manual and other documentation resources online at:
>> <http://www.gnu.org/software/gdb/documentation/>.
>> For help, type "help".
>> Type "apropos word" to search for commands related to "word".
>> (gdb) kill
>> terminate called after throwing an instance of 'gdb_exception_RETURN_MASK_ERROR'
>> IOT/Abort trap (core dumped)
>>
>>
>> The issue has been discussed here:
>> https://sourceware.org/ml/gdb/2017-02/msg00047.html
>>
>> I have manually built and tested GDB-7.12.1 with this patch on AIX-7.2
>> and Ubuntu-16.04 with GCC-6.2 and GCC-4.8.5. On both operating system
>> GDB is working fine with the patch. I generated configure file using
>> autoconf-2.64.
>>
>> The attached patch is for configure.ac file in binutils-gdb, in which
>> one more option "--disable-staticlib" is implemented to link libstdc++
>> and libgcc dynamically.
>> I believe this issue is specific to AIX platform.
>>
>> Please find the attachment for patch file, and ChangeLog file.
>>
>> Thanks and Regards,
>> Nitish K Mishra

[-- Attachment #2: ChangeLog.txt --]
[-- Type: text/plain, Size: 174 bytes --]

2016-03-01  Nitish K Mishra  <nitismis@in.ibm.com>

        * configure.ac: Include one more option "--disable-staticlib"
        to link libstdc++ and libgcc dynamically.

[-- Attachment #3: disable_static_linking.patch --]
[-- Type: text/x-patch, Size: 3150 bytes --]

diff --git a/configure.ac b/configure.ac
index 3ec86c1..c400251 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,7 +140,7 @@ host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktr
 # binutils, gas and ld appear in that order because it makes sense to run
 # "make check" in that particular order.
 # If --enable-gold is used, "gold" may replace "ld".
-host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
+host_tools="flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
 
 # libgcj represents the runtime libraries only used by gcj.
 libgcj="target-libffi \
@@ -337,7 +337,7 @@ case "${ENABLE_GOLD}" in
       *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
       | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
       | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
-      | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-fuchsia*)
+      | *-*-solaris2* | *-*-nto* | *-*-nacl*)
         case "${target}" in
           *-*-linux*aout* | *-*-linux*oldld*)
             ;;
@@ -471,6 +471,13 @@ ENABLE_LIBSTDCXX=default)
   noconfigdirs="$noconfigdirs target-libstdc++-v3"
 fi]
 
+AC_ARG_ENABLE(staticlib,
+AS_HELP_STRING([--disable-staticlib],
+  [do not link libstdc++ and libgcc library statically, default is static linking]),
+ENABLE_STATICLIB=$enableval,
+ENABLE_STATICLIB=yes)
+
+
 # If this is accelerator compiler and its target is intelmic we enable
 # target liboffloadmic by default.  If this is compiler with offloading
 # for intelmic we enable host liboffloadmic by default.  Otherwise
@@ -1406,9 +1413,10 @@ if test -z "$LD"; then
   fi
 fi
 
-# Check whether -static-libstdc++ -static-libgcc is supported.
+# If ENABLE_STATICLIB is set for configuration, check whether -static-libstdc++ -static-libgcc is supported
 have_static_libs=no
-if test "$GCC" = yes; then
+if test "$ENABLE_STATICLIB" = yes; then
+ if test "$GCC" = yes; then
   saved_LDFLAGS="$LDFLAGS"
 
   LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
@@ -1424,6 +1432,7 @@ int main() {}],
   AC_LANG_POP(C++)
 
   LDFLAGS="$saved_LDFLAGS"
+ fi
 fi
 
 ACX_PROG_GNAT
@@ -1741,6 +1750,9 @@ AC_ARG_WITH(stage1-ldflags,
  # trust that they are doing what they want.
  if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
    stage1_ldflags="-static-libstdc++ -static-libgcc"
+   else
+  # If static lib is disabled.
+   stage1_ldflags=""
  fi])
 AC_SUBST(stage1_ldflags)
 
@@ -1768,8 +1780,11 @@ AC_ARG_WITH(boot-ldflags,
  # In stages 2 and 3, default to linking libstdc++ and libgcc
  # statically.  But if the user explicitly specified the libraries to
  # use, trust that they are doing what they want.
- if test "$poststage1_libs" = ""; then
+ if test "$poststage1_libs" = "" -a "$have_static_libs" = yes; then
    poststage1_ldflags="-static-libstdc++ -static-libgcc"
+   else
+   # If static library linking is disabled.
+   poststage1_ldflags=""
  fi])
 AC_SUBST(poststage1_ldflags)
 

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

* Re: [PATCH] For broken exception handling in GDB on AIX platform
  2017-03-01  7:55 Nitish Kumar Mishra
@ 2017-03-01  8:03 ` Nitish Kumar Mishra
  2017-03-07 12:43   ` Nitish Kumar Mishra
  0 siblings, 1 reply; 11+ messages in thread
From: Nitish Kumar Mishra @ 2017-03-01  8:03 UTC (permalink / raw)
  To: gcc-patches

Hi,
I have opened a defect for the same here:
https://sourceware.org/bugzilla/show_bug.cgi?id=21187

Thanks and Regards,
Nitish K Mishra

On Wed, Mar 1, 2017 at 1:25 PM, Nitish Kumar Mishra
<mishra.nitish.88@gmail.com> wrote:
> Hi,
> The patch is for the broken exception handling in GDB on AIX platform.
> When linked statically with libstdc++ and libgcc on AIX platform, GDB
> is facing broken exception handling issues.
> Following is the error output when GDB is linked statically with
> mentioned libraries: (GDB-7.12.1, built with GCC-6.2, 64 bit mode, AIX
> platform):
>
> # ./gdb
> GNU gdb (GDB) 7.12.1
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "powerpc64-ibm-aix7.2.0.0".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word".
> (gdb) kill
> terminate called after throwing an instance of 'gdb_exception_RETURN_MASK_ERROR'
> IOT/Abort trap (core dumped)
>
>
> The issue has been discussed here:
> https://sourceware.org/ml/gdb/2017-02/msg00047.html
>
> I have manually built and tested GDB-7.12.1 with this patch on AIX-7.2
> and Ubuntu-16.04 with GCC-6.2 and GCC-4.8.5. On both operating system
> GDB is working fine with the patch. I generated configure file using
> autoconf-2.64.
>
> The attached patch is for configure.ac file in binutils-gdb, in which
> one more option "--disable-staticlib" is implemented to link libstdc++
> and libgcc dynamically.
> I believe this issue is specific to AIX platform.
>
> Please find the attachment for patch file, and ChangeLog file.
>
> Thanks and Regards,
> Nitish K Mishra

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

* [PATCH] For broken exception handling in GDB on AIX platform
@ 2017-03-01  7:55 Nitish Kumar Mishra
  2017-03-01  8:03 ` Nitish Kumar Mishra
  0 siblings, 1 reply; 11+ messages in thread
From: Nitish Kumar Mishra @ 2017-03-01  7:55 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1815 bytes --]

Hi,
The patch is for the broken exception handling in GDB on AIX platform.
When linked statically with libstdc++ and libgcc on AIX platform, GDB
is facing broken exception handling issues.
Following is the error output when GDB is linked statically with
mentioned libraries: (GDB-7.12.1, built with GCC-6.2, 64 bit mode, AIX
platform):

# ./gdb
GNU gdb (GDB) 7.12.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc64-ibm-aix7.2.0.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) kill
terminate called after throwing an instance of 'gdb_exception_RETURN_MASK_ERROR'
IOT/Abort trap (core dumped)


The issue has been discussed here:
https://sourceware.org/ml/gdb/2017-02/msg00047.html

I have manually built and tested GDB-7.12.1 with this patch on AIX-7.2
and Ubuntu-16.04 with GCC-6.2 and GCC-4.8.5. On both operating system
GDB is working fine with the patch. I generated configure file using
autoconf-2.64.

The attached patch is for configure.ac file in binutils-gdb, in which
one more option "--disable-staticlib" is implemented to link libstdc++
and libgcc dynamically.
I believe this issue is specific to AIX platform.

Please find the attachment for patch file, and ChangeLog file.

Thanks and Regards,
Nitish K Mishra

[-- Attachment #2: ChangeLog.txt --]
[-- Type: text/plain, Size: 174 bytes --]

2016-03-01  Nitish K Mishra  <nitismis@in.ibm.com>

        * configure.ac: Include one more option "--disable-staticlib"
        to link libstdc++ and libgcc dynamically.

[-- Attachment #3: disable_static_linking.patch --]
[-- Type: text/x-patch, Size: 1977 bytes --]

diff --git a/configure.ac b/configure.ac
index 3ec86c1..9bbb024 100644
--- a/configure.ac
+++ b/configure.ac
@@ -471,6 +471,13 @@ ENABLE_LIBSTDCXX=default)
   noconfigdirs="$noconfigdirs target-libstdc++-v3"
 fi]
 
+AC_ARG_ENABLE(staticlib,
+AS_HELP_STRING([--disable-staticlib],
+  [do not link libstdc++ and libgcc library statically]),
+have_static_lib=$enableval,
+have_static_lib=yes)
+
+
 # If this is accelerator compiler and its target is intelmic we enable
 # target liboffloadmic by default.  If this is compiler with offloading
 # for intelmic we enable host liboffloadmic by default.  Otherwise
@@ -1406,9 +1413,10 @@ if test -z "$LD"; then
   fi
 fi
 
-# Check whether -static-libstdc++ -static-libgcc is supported.
-have_static_libs=no
-if test "$GCC" = yes; then
+# If enable_staticlib is set for configuration, check whether -static-libstdc++ -static-libgcc is supported
+
+if test "$have_static_lib" = yes; then
+ if test "$GCC" = yes; then
   saved_LDFLAGS="$LDFLAGS"
 
   LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
@@ -1424,6 +1432,7 @@ int main() {}],
   AC_LANG_POP(C++)
 
   LDFLAGS="$saved_LDFLAGS"
+ fi
 fi
 
 ACX_PROG_GNAT
@@ -1741,6 +1750,9 @@ AC_ARG_WITH(stage1-ldflags,
  # trust that they are doing what they want.
  if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
    stage1_ldflags="-static-libstdc++ -static-libgcc"
+   else
+  # If static lib is disabled.
+   stage1_ldflags=""
  fi])
 AC_SUBST(stage1_ldflags)
 
@@ -1768,8 +1780,11 @@ AC_ARG_WITH(boot-ldflags,
  # In stages 2 and 3, default to linking libstdc++ and libgcc
  # statically.  But if the user explicitly specified the libraries to
  # use, trust that they are doing what they want.
- if test "$poststage1_libs" = ""; then
+ if test "$poststage1_libs" = "" -a "$have_static_lib" = yes; then
    poststage1_ldflags="-static-libstdc++ -static-libgcc"
+   else
+   # If static lib is disabled.
+   poststage1_ldflags=""
  fi])
 AC_SUBST(poststage1_ldflags)
 

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

end of thread, other threads:[~2017-04-25  7:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27  4:56 [PATCH] For broken exception handling in GDB on AIX platform David Edelsohn
2017-03-29 19:31 ` Jeff Law
  -- strict thread matches above, loose matches on Subject: below --
2017-04-25  7:31 Sangamesh Mallayya
2017-03-08  9:27 Nitish Kumar Mishra
2017-03-27  0:54 ` Joel Brobecker
2017-03-29 19:42   ` Jeff Law
2017-04-04  7:39     ` Nitish Kumar Mishra
2017-03-01  7:55 Nitish Kumar Mishra
2017-03-01  8:03 ` Nitish Kumar Mishra
2017-03-07 12:43   ` Nitish Kumar Mishra
2017-03-07 22:42     ` Bernhard Reutner-Fischer

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