public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: RFA: darwin PATCH to fix build, internal visibility
@ 2012-10-08 12:28 Dominique Dhumieres
  2012-10-08 17:54 ` Jason Merrill
  0 siblings, 1 reply; 9+ messages in thread
From: Dominique Dhumieres @ 2012-10-08 12:28 UTC (permalink / raw)
  To: gcc-patches; +Cc: jason

> > It appears that the patch should also special case the "scan-assembler \\\\.internal.*Foo.methodEv"
> > tests in g++.dg/ext/visibility/pragma-override1.C and g++.dg/ext/visibility/pragma-override2.C
> > on darwin as well...
>
> Done, thanks.

Jason,

These tests are still failing on darwin. I think that
target { ! *-*-solaris2* } { ! *-*-darwin* }
sould be replaced with
target { ! { *-*-solaris2* *-*-darwin* } }

TIA

Dominique

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

* Re: RFA: darwin PATCH to fix build, internal visibility
  2012-10-08 12:28 RFA: darwin PATCH to fix build, internal visibility Dominique Dhumieres
@ 2012-10-08 17:54 ` Jason Merrill
  2012-10-09 13:48   ` Dominique Dhumieres
  0 siblings, 1 reply; 9+ messages in thread
From: Jason Merrill @ 2012-10-08 17:54 UTC (permalink / raw)
  To: Dominique Dhumieres; +Cc: gcc-patches, Mike Stump

On 10/08/2012 08:28 AM, Dominique Dhumieres wrote:
> These tests are still failing on darwin. I think that
> target { ! *-*-solaris2* } { ! *-*-darwin* }
> sould be replaced with
> target { ! { *-*-solaris2* *-*-darwin* } }

Could someone with a darwin box handy make the appropriate change?

Thanks.

Jason


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

* Re: RFA: darwin PATCH to fix build, internal visibility
  2012-10-08 17:54 ` Jason Merrill
@ 2012-10-09 13:48   ` Dominique Dhumieres
  2012-10-09 20:17     ` Mike Stump
  0 siblings, 1 reply; 9+ messages in thread
From: Dominique Dhumieres @ 2012-10-09 13:48 UTC (permalink / raw)
  To: jason, dominiq; +Cc: mikestump, gcc-patches

> > These tests are still failing on darwin. I think tha
> > target { ! *-*-solaris2* } { ! *-*-darwin* }
> > sould be replaced with
> > target { ! { *-*-solaris2* *-*-darwin* } }
>
> Could someone with a darwin box handy make the appropriate change?

I have never really understood the logic of the "target" syntax,
so IMO the problem with the proposed change is not with darwin,
but with other platforms I don't have access to.

Indeed I have checked on x86_64-apple-darwin10 and powerpc-apple-darwin9
that the failures go away with the following patch:

diff -up ../_clean/gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C
--- ../_clean/gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C	2012-10-04 19:50:52.000000000 +0200
+++ gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C	2012-10-08 10:29:40.000000000 +0200
@@ -1,7 +1,7 @@
 /* Test that #pragma GCC visibility does not override class member specific settings. */
 /* { dg-do compile } */
 /* { dg-require-visibility "internal" } */
-/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" { target { ! *-*-solaris2* } { ! *-*-darwin* } } } }*/
+/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" { target { ! { *-*-solaris2* *-*-darwin* } } } } }*/
 /* { dg-final { scan-assembler "\\.(internal|hidden).*Foo.methodEv" { target *-*-solaris2* } } } */
 
 #pragma GCC visibility push(hidden)
diff -up ../_clean/gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C
--- ../_clean/gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C	2012-10-04 19:50:52.000000000 +0200
+++ gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C	2012-10-08 10:30:32.000000000 +0200
@@ -1,7 +1,7 @@
 /* Test that #pragma GCC visibility does not override class member specific settings. */
 /* { dg-do compile } */
 /* { dg-require-visibility "internal" } */
-/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" { target { ! *-*-solaris2* } { ! *-*-darwin* } } } } */
+/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" { target { ! { *-*-solaris2* *-*-darwin* } } } } } */
 /* { dg-final { scan-assembler "\\.(internal|hidden).*Foo.methodEv" { target *-*-solaris2* } } } */
 
 #pragma GCC visibility push(hidden)

Dominique

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

* Re: RFA: darwin PATCH to fix build, internal visibility
  2012-10-09 13:48   ` Dominique Dhumieres
@ 2012-10-09 20:17     ` Mike Stump
  2012-10-11 15:26       ` Jason Merrill
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Stump @ 2012-10-09 20:17 UTC (permalink / raw)
  To: Dominique Dhumieres; +Cc: jason, gcc-patches

On Oct 9, 2012, at 6:48 AM, Dominique Dhumieres <dominiq@lps.ens.fr> wrote:
>>> These tests are still failing on darwin. I think tha
>>> target { ! *-*-solaris2* } { ! *-*-darwin* }
>>> sould be replaced with
>>> target { ! { *-*-solaris2* *-*-darwin* } }
>> 
>> Could someone with a darwin box handy make the appropriate change?
> 
> I have never really understood the logic of the "target" syntax,
> so IMO the problem with the proposed change is not with darwin,
> but with other platforms I don't have access to.

Ok.  I think it is pretty safe, if darwin works.

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

* Re: RFA: darwin PATCH to fix build, internal visibility
  2012-10-09 20:17     ` Mike Stump
@ 2012-10-11 15:26       ` Jason Merrill
  0 siblings, 0 replies; 9+ messages in thread
From: Jason Merrill @ 2012-10-11 15:26 UTC (permalink / raw)
  To: Mike Stump; +Cc: Dominique Dhumieres, gcc-patches

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

OK, I've checked this in:

[-- Attachment #2: vis-dar.patch --]
[-- Type: text/x-patch, Size: 1908 bytes --]

commit 2425dc8daa33d8b5d15c803c9bf2f51f5e1915a0
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Oct 9 21:16:52 2012 -0400

    	* g++.dg/ext/visibility/pragma-override1.C: Fix target markup.
    	* g++.dg/ext/visibility/pragma-override2.C: Fix target markup.

diff --git a/gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C b/gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C
index b813390..c13161d 100644
--- a/gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C
+++ b/gcc/testsuite/g++.dg/ext/visibility/pragma-override1.C
@@ -1,7 +1,7 @@
 /* Test that #pragma GCC visibility does not override class member specific settings. */
 /* { dg-do compile } */
 /* { dg-require-visibility "internal" } */
-/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" { target { ! *-*-solaris2* } { ! *-*-darwin* } } } }*/
+/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" { target { ! { *-*-solaris2* *-*-darwin* } } } } } */
 /* { dg-final { scan-assembler "\\.(internal|hidden).*Foo.methodEv" { target *-*-solaris2* } } } */
 
 #pragma GCC visibility push(hidden)
diff --git a/gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C b/gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C
index 3ceaf4a..25e9cea 100644
--- a/gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C
+++ b/gcc/testsuite/g++.dg/ext/visibility/pragma-override2.C
@@ -1,7 +1,7 @@
 /* Test that #pragma GCC visibility does not override class member specific settings. */
 /* { dg-do compile } */
 /* { dg-require-visibility "internal" } */
-/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" { target { ! *-*-solaris2* } { ! *-*-darwin* } } } } */
+/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" { target { ! { *-*-solaris2* *-*-darwin* } } } } } */
 /* { dg-final { scan-assembler "\\.(internal|hidden).*Foo.methodEv" { target *-*-solaris2* } } } */
 
 #pragma GCC visibility push(hidden)

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

* Re: RFA: darwin PATCH to fix build, internal visibility
  2012-10-04 13:42   ` Jack Howarth
@ 2012-10-04 15:36     ` Jason Merrill
  0 siblings, 0 replies; 9+ messages in thread
From: Jason Merrill @ 2012-10-04 15:36 UTC (permalink / raw)
  To: Jack Howarth; +Cc: Mike Stump, gcc-patches List

On 10/04/2012 09:41 AM, Jack Howarth wrote:
> It appears that the patch should also special case the "scan-assembler \\\\.internal.*Foo.methodEv"
> tests in g++.dg/ext/visibility/pragma-override1.C and g++.dg/ext/visibility/pragma-override2.C
> on darwin as well...

Done, thanks.

Jason


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

* Re: RFA: darwin PATCH to fix build, internal visibility
  2012-10-03 22:26 ` Mike Stump
@ 2012-10-04 13:42   ` Jack Howarth
  2012-10-04 15:36     ` Jason Merrill
  0 siblings, 1 reply; 9+ messages in thread
From: Jack Howarth @ 2012-10-04 13:42 UTC (permalink / raw)
  To: Mike Stump; +Cc: Jason Merrill, gcc-patches List

On Wed, Oct 03, 2012 at 03:26:14PM -0700, Mike Stump wrote:
> On Oct 3, 2012, at 12:04 PM, Jason Merrill <jason@redhat.com> wrote:
> > This patch fixes a couple of Darwin issues I noticed with a cross-compiler:
> > 
> > 1) Adds a couple of consts to avoid const-correctness errors.
> > 2) Treats visibility "internal" like "hidden" rather than like "default".  The documentation says that internal is hidden + processor-specific semantics, so treating it as just hidden makes sense to me.
> > 
> > OK for trunk?
> 
> Ok.


FYI, the x86_64-apple-darwin12 testsuite results with the proposed patch are at...

http://gcc.gnu.org/ml/gcc-testresults/2012-10/msg00434.html

It appears that the patch should also special case the "scan-assembler \\\\.internal.*Foo.methodEv"
tests in g++.dg/ext/visibility/pragma-override1.C and g++.dg/ext/visibility/pragma-override2.C 
on darwin as well...

FAIL: g++.dg/ext/visibility/pragma-override1.C -std=c++98  scan-assembler \\\\.internal.*Foo.methodEv
FAIL: g++.dg/ext/visibility/pragma-override1.C -std=c++11  scan-assembler \\\\.internal.*Foo.methodEv
FAIL: g++.dg/ext/visibility/pragma-override2.C -std=c++98  scan-assembler \\\\.internal.*Foo.methodEv
FAIL: g++.dg/ext/visibility/pragma-override2.C -std=c++11  scan-assembler \\\\.internal.*Foo.methodEv

               Jack

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

* Re: RFA: darwin PATCH to fix build, internal visibility
  2012-10-03 19:04 Jason Merrill
@ 2012-10-03 22:26 ` Mike Stump
  2012-10-04 13:42   ` Jack Howarth
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Stump @ 2012-10-03 22:26 UTC (permalink / raw)
  To: Jason Merrill; +Cc: gcc-patches List

On Oct 3, 2012, at 12:04 PM, Jason Merrill <jason@redhat.com> wrote:
> This patch fixes a couple of Darwin issues I noticed with a cross-compiler:
> 
> 1) Adds a couple of consts to avoid const-correctness errors.
> 2) Treats visibility "internal" like "hidden" rather than like "default".  The documentation says that internal is hidden + processor-specific semantics, so treating it as just hidden makes sense to me.
> 
> OK for trunk?

Ok.

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

* RFA: darwin PATCH to fix build, internal visibility
@ 2012-10-03 19:04 Jason Merrill
  2012-10-03 22:26 ` Mike Stump
  0 siblings, 1 reply; 9+ messages in thread
From: Jason Merrill @ 2012-10-03 19:04 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc-patches List

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

This patch fixes a couple of Darwin issues I noticed with a cross-compiler:

1) Adds a couple of consts to avoid const-correctness errors.
2) Treats visibility "internal" like "hidden" rather than like 
"default".  The documentation says that internal is hidden + 
processor-specific semantics, so treating it as just hidden makes sense 
to me.

OK for trunk?

Jason

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

commit 907f8d9588da2e65cf938985639bfaf0dde53c6f
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Oct 3 09:55:25 2012 -0400

    	* config/darwin.c (darwin_assemble_visibility): Treat
    	VISIBILITY_INTERNAL as hidden.
    
    	* config/darwin-c.c (find_subframework_file): Add missing const.
    	(framework_construct_pathname): Likewise.

diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
index a642f66..8e48c30 100644
--- a/gcc/config/darwin-c.c
+++ b/gcc/config/darwin-c.c
@@ -267,7 +267,7 @@ static struct framework_header framework_header_dirs[] = {
 static char *
 framework_construct_pathname (const char *fname, cpp_dir *dir)
 {
-  char *buf;
+  const char *buf;
   size_t fname_len, frname_len;
   cpp_dir *fast_dir;
   char *frname;
@@ -344,7 +344,7 @@ find_subframework_file (const char *fname, const char *pname)
 {
   char *sfrname;
   const char *dot_framework = ".framework/";
-  char *bufptr;
+  const char *bufptr;
   int sfrname_len, i, fname_len;
   struct cpp_dir *fast_dir;
   static struct cpp_dir subframe_dir;
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 54c92d1..5a9f50a 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -2623,7 +2623,7 @@ darwin_assemble_visibility (tree decl, int vis)
 {
   if (vis == VISIBILITY_DEFAULT)
     ;
-  else if (vis == VISIBILITY_HIDDEN)
+  else if (vis == VISIBILITY_HIDDEN || vis == VISIBILITY_INTERNAL)
     {
       fputs ("\t.private_extern ", asm_out_file);
       assemble_name (asm_out_file,
@@ -2631,7 +2631,7 @@ darwin_assemble_visibility (tree decl, int vis)
       fputs ("\n", asm_out_file);
     }
   else
-    warning (OPT_Wattributes, "internal and protected visibility attributes "
+    warning (OPT_Wattributes, "protected visibility attribute "
 	     "not supported in this configuration; ignored");
 }
 

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

end of thread, other threads:[~2012-10-11 15:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-08 12:28 RFA: darwin PATCH to fix build, internal visibility Dominique Dhumieres
2012-10-08 17:54 ` Jason Merrill
2012-10-09 13:48   ` Dominique Dhumieres
2012-10-09 20:17     ` Mike Stump
2012-10-11 15:26       ` Jason Merrill
  -- strict thread matches above, loose matches on Subject: below --
2012-10-03 19:04 Jason Merrill
2012-10-03 22:26 ` Mike Stump
2012-10-04 13:42   ` Jack Howarth
2012-10-04 15:36     ` Jason Merrill

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