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: [PATCH] PR rtl-optimization/32219: optimizer causes wrong code in pic/hidden/weak symbol checking


H.J.,
     The new patch bootstraps okay on x86_64-apple-darwin14 but I
discovered that you need a small adjustment in the deja-gnu
statements...

 --- /Users/howarth/gcc-5-20150206/gcc/testsuite/gcc.dg/visibility-22.c
2015-02-06 21:45:04.000000000 -0500
+++ /sw/src/fink.build/gcc50-5.0.0-1000/gcc-5-20150206/gcc/testsuite/gcc.dg/visibility-22.c
2015-02-07 03:24:42.000000000 -0500
@@ -8,9 +8,9 @@
 /* For kernel modules and static RTPs, the loader treats undefined weak
    symbols in the same way as undefined strong symbols.  The test
    therefore fails to load, so skip it.  */
+/* { dg-options "-fPIC" { target fpic } } */
 /* { dg-additional-options "-Wl,-undefined,dynamic_lookup" { target
*-*-darwin* } } */
 /* { dg-additional-options "-Wl,-flat_namespace" { target
*-*-darwin[89]* } } */
-/* { dg-options "-fPIC" { target fpic } } */

 extern void foo () __attribute__((weak,visibility("hidden")));
 int

If you don't define a dg-options line first, the dg-additional-options
lines have no effect.
                 Jack

On Fri, Feb 6, 2015 at 8:55 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Feb 6, 2015 at 5:51 PM, Jack Howarth <howarth.at.gcc@gmail.com> wrote:
>> H.J.,
>>      This patch also seems to be causing a huge number of regressions
>> in the g++ test suite due to linkage warnings on darwin of the form...
>>
>> ld: warning: direct access in Model::~Model() to global weak symbol
>> vtable for Model means the weak symbol cannot be overridden at
>> runtime. This was likely caused by different translation units being
>> compiled with different visibility settings.
>
> Can you try my new patch?
>
>> Can this change wait until stage1?
>>             Jack
>>
>> On Fri, Feb 6, 2015 at 4:41 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> On Fri, Feb 6, 2015 at 1:31 PM, Jack Howarth <howarth.at.gcc@gmail.com> wrote:
>>>> H.J.,
>>>>     On x86_64-apple-darwin14, your patch applied to r220481 results in...
>>>>
>>>> FAIL: gcc.dg/visibility-22.c (test for excess errors)
>>>> FAIL: gcc.dg/visibility-23.c scan-hidden private_extern[ \t_]*_?foo
>>>>
>>>> with...
>>>>
>>>> Executing on host:
>>>> /sw/src/fink.build/gcc50-5.0.0-1000/darwin_objdir/gcc/xgcc
>>>> -B/sw/src/fink.build/gcc50-5.0.0-1000/darwin_objdir/gcc/
>>>> /sw/src/fink.build/gcc50-5.0.0-1000/gcc-5-20150206/gcc/testsuite/gcc.dg/visibility-22.c
>>>>  -fno-diagnostics-show-caret -fdiagnostics-color=never   -fPIC  -lm
>>>> -m32  -o ./visibility-22.exe    (timeout = 300)
>>>> spawn -ignore SIGHUP
>>>> /sw/src/fink.build/gcc50-5.0.0-1000/darwin_objdir/gcc/xgcc
>>>> -B/sw/src/fink.build/gcc50-5.0.0-1000/darwin_objdir/gcc/
>>>> /sw/src/fink.build/gcc50-5.0.0-1000/gcc-5-20150206/gcc/testsuite/gcc.dg/visibility-22.c
>>>> -fno-diagnostics-show-caret -fdiagnostics-color=never -fPIC -lm -m32
>>>> -o ./visibility-22.exe^M
>>>> Undefined symbols for architecture i386:^M
>>>>   "_foo", referenced from:^M
>>>>       _main in ccMD1qjz.o^M
>>>>       _main in ccMD1qjz.o^M
>>>> ld: symbol(s) not found for architecture i386^M
>>>> collect2: error: ld returned 1 exit status^M
>>>> compiler exited with status 1
>>>> output is:
>>>> Undefined symbols for architecture i386:^M
>>>>   "_foo", referenced from:^M
>>>>       _main in ccMD1qjz.o^M
>>>>       _main in ccMD1qjz.o^M
>>>> ld: symbol(s) not found for architecture i386^M
>>>> collect2: error: ld returned 1 exit status^M
>>>>
>>>> FAIL: gcc.dg/visibility-22.c (test for excess errors)
>>>>
>>>> Executing on host:
>>>> /sw/src/fink.build/gcc50-5.0.0-1000/darwin_objdir/gcc/xgcc
>>>> -B/sw/src/fink.build/gcc50-5.0.0-1000/darwin_objdir/gcc/
>>>> /sw/src/fink.build/gcc50-5.0.0-1000/gcc-5-20150206/gcc/testsuite/gcc.dg/visibility-23.c
>>>>  -fno-diagnostics-show-caret -fdiagnostics-color=never   -fPIC -S
>>>> -m32  -o visibility-23.s    (timeout = 300)
>>>> spawn -ignore SIGHUP
>>>> /sw/src/fink.build/gcc50-5.0.0-1000/darwin_objdir/gcc/xgcc
>>>> -B/sw/src/fink.build/gcc50-5.0.0-1000/darwin_objdir/gcc/
>>>> /sw/src/fink.build/gcc50-5.0.0-1000/gcc-5-20150206/gcc/testsuite/gcc.dg/visibility-23.c
>>>> -fno-diagnostics-show-caret -fdiagnostics-color=never -fPIC -S -m32 -o
>>>> visibility-23.s^M
>>>> PASS: gcc.dg/visibility-23.c (test for excess errors)
>>>> FAIL: gcc.dg/visibility-23.c scan-hidden private_extern[ \t_]*_?foo
>>>>
>>>
>>> Does Darwin support undefined hidden weak symbol?
>>> Can you compile and gcc/testsuite/gcc.dg/visibility-22.c
>>> with clang on Darwin?
>>>
>>> --
>>> H.J.
>
>
>
> --
> H.J.


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