This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: _Unwind_GetIPInfo Redux: Patch for PR target/27880


sje@cup.hp.com schrieb:
> I have been looking at the _Unwind_GetIPInfo issues again.  There are two
> problems, one is PR target/27880 where static linking on IA64 Linux does
> not work when GCC is built with --with-system-libunwind and the other is
> the fact that we use link based tests to determine if _Unwind_GetIPInfo
> exists in the libstdc++-v3 and libjava configures and this does not
> work if you are building cross-compilers.  This patch is my attempt to
> address both issues.
> 
> At first I tried to fix the link test in the gcc directory to set or not
> set HAVE_GETIPINFO correctly.  I think that if we are on IA64 Linux and
> we specify --with-system-libunwind then HAVE_GETIPINFO should not be set
> because the IA64 system unwind library does not have this routine in it.
> 
> This doesn't work though because _Unwind_GetIPInfo exists in libgcc (from
> unwind-compat.o) on IA64 so even if the system libunwind doesn't have
> _Unwind_GetIPInfo we still think it does because we find it in libgcc.
> There doesn't seem to be anyway around this problem since GCC's that have
> this have already been released and could be used to build the latest GCC.
> 
> My second thought was to set the default values for with_system_libunwind
> and for HAVE_GETIPINFO in gcc/configure.ac and then allow those
> values to be overridden in config.gcc (based on target) or with the
> --with-system-libunwind option to configure.  This seems doable and
> reasonable but it doesn't address the checks in libstdc++-v3 and libjava
> where we would still need to do link tests to check for GetIPInfo and we
> don't want to do that (for cross-compiling reasons) and they won't work
> correctly because of the _Unwind_GetIPInfo in libgcc.  I couldn't think
> of any good way for the HAVE_GETIPINFO value set in the gcc directory
> to be communicated to the libstdc++-v3 and libjava configures.
> 
> So my final fix was to put the default settings of with_system_libunwind
> and HAVE_GETIPINFO into the GCC_CHECK_UNWIND_GETIPINFO autoconf macro
> in config/unwind_ipinfo.m4 and let that macro use the target variable
> and the --with-system-libunwind configure option to change the defaults
> if needed.  Then gcc, libstdc++-v3, and libjava will all use the same
> method to determine HAVE_GETIPINFO and it won't be a link based test.
> 
> The only problem is that we now have an autoconf macro looking directly
> at the $target variable.  While I don't think that is ideal, I think it
> might be acceptable as a way to address both of the _Unwind_GetIPInfo
> issues that we want to fix.
> 
> Here is a patch, I am still testing it but I wanted to send it out and
> see what people think, see if this is an acceptable approach, or if
> someone might have a better idea of how to fix the problem.
> 
> Comments?

Built a native ia64-linux compiler configured --with-system-libunwind , with ada enabled, after
regenerating the config files in libstdc==-v3 and libjava. No regressions seen in the testsuite
compared to a build without this patch.

  Matthias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]