Boost logo

Boost :

Subject: Re: [boost] [Boost.DLL] Formal Review request
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2014-10-13 04:16:05


2014-10-08 15:35 GMT+04:00 Niall Douglas <s_sourceforge_at_[hidden]>:

> On 8 Oct 2014 at 11:23, Mathias Gaunard wrote:
>
> > > Your DLL library could provide a portable method for auto generating
> > > aliases with the Itanium ABI. As I mentioned, it is fairly trivial to
> > > write some metaprogramming which will output an Itanium mangling for
> > > some input type. You just then need to regex in the fully qualified
> > > name of the item, and finally run a pass collapsing repetition (a
> > > regex matcher will suffiice). Itanium is very logical, no surprises.
> > > I keep a quick cheat sheet document on symbol mangling at
> > > https://github.com/ned14/NiallsCPP11Utilities/blob/master/demanglers/c
> > > alling_conventions.pdf, you may find it useful. The official
> > > http://mentorembedded.github.io/cxx-abi/abi.html#mangling isn't bad
> > > either.
> >
> > Since you seem to know the subject matter very well yourself, wouldn't
> > it be better if you could contribute that component?
>
> Well, I do have a lot of demands on my time these next few months.
> Currently three new Boost libraries will be appearing from me by
> March 2015, so I am not volunteering for even more work.
>
> That said, given how trivial the above metaprogrammed Itanium type
> mangler is, I would be happy to collaborate with someone else on an
> implementation. You'll just need to be patient with my rate of
> progress, I only get Saturdays most weeks for non-work work items and
> that is usually spent on closing Boost.Thread defects or trying to
> find some time to work on AFIO.
>

I'd appreciate any help. Task of name mangling does not seem review
blocking and can be easily done later at any time.

Here's just an idea how importing could be done in a nice way without
aliases if we had a fully functional mangler:

dll::shared_library lib(path_to_lib);
typedef boost::variant<int, short> vis_t;

// mangle_get method has signature of the method and it's full name,
// so a Mangler could create a correct mangled name without forward
declaration
auto f = lib.mangle_get<vis_t(vis_t, vis_t)>("foo::adl_barrier::
export_me_function");

// mangle_get method has type of the variable and it's full name,
// so a Mangler could create a correct mangled name without forward
declaration
auto v = lib.mangle_get<vis_t>("foo::adl_barrier::export_me_variable");

-- 
Best regards,
Antony Polukhin

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk