libWebKitSystemInterfaceLeopard.a with private extern symbols?

View: New views
5 Messages — Rating Filter:   Alert me  

libWebKitSystemInterfaceLeopard.a with private extern symbols?

by Bugzilla from mark@chromium.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

'kittens,

Would it be possible to get a copy of
libWebKitSystemInterfaceLeopard.a (from WebKit/WebKitLibraries) with
all of its symbols marked private extern?  Or, if nobody actually
needs these symbols to be exported so globally, can the version that's
currently checked in be replaced with one that's got all of the
symbols marked private extern?

I'm doing symbol table maintenance on Mac Chromium, and these symbols
are some of the few that remain that we actually don't need to expose
to anyone.  I could set something up as a workaround to make these
private extern, but if at all possible, I'd rather do it the right way
by getting a build of the library with the symbols already marked
private extern.

Thanks,
Mark
_______________________________________________
webkit-dev mailing list
webkit-dev@...
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Re: libWebKitSystemInterfaceLeopard.a with private extern symbols?

by Darin Adler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 15, 2009, at 3:40 PM, Mark Mentovai wrote:

> I could set something up as a workaround to make these private extern

I don’t remember if anyone answered you.

A simple way to transform the library into one with private extern  
would be to use ld and -r, -exported_symbol or -exported_symbols_list,  
and -keep_private_externs to make all the symbols private. This would  
eliminate any need to get a new version of the library from someone at  
Apple, and should be quite simple to do. The only thing I don’t know  
is how to say “no exported symbols”, but it could be as simple as -
exported_symbols_list /dev/null -- you should give it a try.

I believe the problem occurs because the Chromium build uses a  
different method for controlling what’s exported than what we use in  
the standard Mac OS X WebKit build, which uses -exported_symbols_list.

     -- Darin

_______________________________________________
webkit-dev mailing list
webkit-dev@...
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Re: libWebKitSystemInterfaceLeopard.a with private extern symbols?

by Bugzilla from mark@chromium.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Darin Adler wrote:
> I don’t remember if anyone answered you.

You're the first, but thanks for the response.

> A simple way to transform the library into one with private extern would be
> to use ld and -r, -exported_symbol or -exported_symbols_list, and
> -keep_private_externs to make all the symbols private. This would eliminate
> any need to get a new version of the library from someone at Apple, and
> should be quite simple to do. The only thing I don’t know is how to say “no
> exported symbols”, but it could be as simple as -exported_symbols_list
> /dev/null -- you should give it a try.

This would work, but the steps to prepare it get a little bit heinous.
 I'd need to "lipo -thin" it first to break it up by architecture, and
then "ar -x" it to break it up into .o files.  Then it's ld as you
describe, "ar -rc" to get it back into a .a, and "lipo -create".
Sure, it's doable, but with the way our build is structured now, we
don't really do anything with libWebCoreSystemInterfaceLeopard.a
outside of WebCore.gyp, which is now in your repository, so all of
these machinations would really belong there...

For that matter, I considered just writing something to rewrite the
archive and set N_PEXT on everything in the symbol tables.  Same
effect, more work, fewer temporary files.

> I believe the problem occurs because the Chromium build uses a different
> method for controlling what’s exported than what we use in the standard Mac
> OS X WebKit build, which uses -exported_symbols_list.

Yup, that's right.  The first thing I tried, which involved minimal
boat-rocking, was to "strip -R" our output to trim the symbols we
didn't need.  That would have been fine, except in order to do it
properly, I'd have to enumerate libWebCoreSystemInterfaceLeopard.a's
symbols first.  With archive member selection and dead code stripping,
the set of symbols that we'd see in the linked product isn't fully
deterministic, though, and Apple's "strip -R" gives an error when it's
can't find a symbol that it's told to remove.  Oh well.

Would these libraries with private extern symbols be unsuitable for
Apple's WebKit build?  The easiest approach, if it would work for you,
would just be to build those libraries with -fvisibility=hidden
(GCC_SYMBOLS_PRIVATE_EXTERN=YES), check them in, and call it a day.
I'd be surprised if you ever needed these symbols exported now or in
the future, and "grep WK $(find . -name \*exp)" doesn't show anything.

Mark
_______________________________________________
webkit-dev mailing list
webkit-dev@...
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Re: libWebKitSystemInterfaceLeopard.a with private extern symbols?

by Darin Adler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 20, 2009, at 10:15 AM, Mark Mentovai wrote:

> Would these libraries with private extern symbols be unsuitable for  
> Apple's WebKit build?

Probably not. But even though this is easy it could be a long time  
until someone gets the free time to make and test this simple change.  
I was trying to offer you the power to do this on your own schedule,  
but I see that you’ve already tried it.

Given your story, it does seem that using nm combined with strip -R  
you could do this pretty simply, but perhaps that’s just another dead  
end.

     -- Darin

_______________________________________________
webkit-dev mailing list
webkit-dev@...
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Re: libWebKitSystemInterfaceLeopard.a with private extern symbols?

by Bugzilla from mark@chromium.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Darin Adler wrote:
> Probably not. But even though this is easy it could be a long time until
> someone gets the free time to make and test this simple change. I was trying
> to offer you the power to do this on your own schedule, but I see that
> you’ve already tried it.
>
> Given your story, it does seem that using nm combined with strip -R you
> could do this pretty simply, but perhaps that’s just another dead end.

Yup, given that we can't easily forecast which symbols will wind up in
the linked product without actually linking it, this isn't easy,
unless we want to start hacking in more magic with a custom strip
command.

All things considered, I thought your initial recommendation was
closest to ideal, short of getting rebuilds of those libraries.  I've
put a patch to implement this for the GYP-based Mac build (currently
only used by Chromium) at
https://bugs.webkit.org/show_bug.cgi?id=30590 .

Thanks,
Mark
_______________________________________________
webkit-dev mailing list
webkit-dev@...
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev