[ 
https://issues.apache.org/jira/browse/THRIFT-4308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James E. King, III updated THRIFT-4308:
---------------------------------------
    Description: 
I had to disable the deimos hooks for libevent and openssl because they were 
causing build failures in 0.11.0.  A result of this change is that dlang is NOT 
tested in "make cross" at all, because the test executables are only generated 
if openssl support exists, and it does not.

It turns out this is some sort of link ordering issue.  On further diagnosis, 
the dmd command outputs this build line when you add -v:
{noformat}
root@f82a62661052:/thrift/src/lib/d/test# cc client_pool_test.o -o 
client_pool_test -m64 -levent -lssl -lcrypto -L/usr/lib/x86_64-linux-gnu 
-Xlinker --export-dynamic ../../../lib/d/libthriftd.a ../libthriftd-event.a 
../libthriftd-ssl.a -Xlinker -Bstatic -lphobos2 -Xlinker -Bdynamic -lpthread 
-lm -lrt -ldl
../libthriftd-event.a(libevent_1_846.o): In function 
`_D6thrift5async8libevent21TLibeventAsyncManager6__ctorMFZC6thrift5async8libevent21TLibeventAsyncManager':
src/thrift/async/libevent.d:(.text._D6thrift5async8libevent21TLibeventAsyncManager6__ctorMFZC6thrift5async8libevent21TLibeventAsyncManager+0x11):
 undefined reference to `event_base_new'
src/thrift/async/libevent.d:(.text._D6thrift5async8libevent21TLibeventAsyncManager6__ctorMFZC6thrift5async8libevent21TLibeventAsyncManager+0xa3):
 undefined reference to `event_new'
src/thrift/async/libevent.d:(.text._D6thrift5async8libevent21TLibeventAsyncManager6__ctorMFZC6thrift5async8libevent21TLibeventAsyncManager+0xb1):
 undefined reference to `event_add'
{noformat}

If you add -Wl,--start-group before the event library, OR move event, ssl, and 
crypto to the end of the library list, the link completes.

  was:
I had to disable the deimos hooks for libevent and openssl because they were 
causing build failures.  For openssl the deimos library only supports up to 
1.0.1, and ubuntu-xenial has 1.0.2; for libevent I was unable to get some of 
the "make check" tests to link, citing unreferenced methods that were actually 
in the libevent.so file that ld resolved to, so I don't know what's going on 
there.

A result of this change is that dlang is NOT tested in "make cross" at all, 
because the test executables are only generated if openssl support exists, and 
it does not.


> D language docker images need demios for libevent and openssl fixed to 
> re-enable make cross on dlang
> ----------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-4308
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4308
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Build Process, D - Library
>    Affects Versions: 0.11.0
>         Environment: docker:ubuntu-xenial
>            Reporter: James E. King, III
>            Assignee: James E. King, III
>            Priority: Major
>
> I had to disable the deimos hooks for libevent and openssl because they were 
> causing build failures in 0.11.0.  A result of this change is that dlang is 
> NOT tested in "make cross" at all, because the test executables are only 
> generated if openssl support exists, and it does not.
> It turns out this is some sort of link ordering issue.  On further diagnosis, 
> the dmd command outputs this build line when you add -v:
> {noformat}
> root@f82a62661052:/thrift/src/lib/d/test# cc client_pool_test.o -o 
> client_pool_test -m64 -levent -lssl -lcrypto -L/usr/lib/x86_64-linux-gnu 
> -Xlinker --export-dynamic ../../../lib/d/libthriftd.a ../libthriftd-event.a 
> ../libthriftd-ssl.a -Xlinker -Bstatic -lphobos2 -Xlinker -Bdynamic -lpthread 
> -lm -lrt -ldl
> ../libthriftd-event.a(libevent_1_846.o): In function 
> `_D6thrift5async8libevent21TLibeventAsyncManager6__ctorMFZC6thrift5async8libevent21TLibeventAsyncManager':
> src/thrift/async/libevent.d:(.text._D6thrift5async8libevent21TLibeventAsyncManager6__ctorMFZC6thrift5async8libevent21TLibeventAsyncManager+0x11):
>  undefined reference to `event_base_new'
> src/thrift/async/libevent.d:(.text._D6thrift5async8libevent21TLibeventAsyncManager6__ctorMFZC6thrift5async8libevent21TLibeventAsyncManager+0xa3):
>  undefined reference to `event_new'
> src/thrift/async/libevent.d:(.text._D6thrift5async8libevent21TLibeventAsyncManager6__ctorMFZC6thrift5async8libevent21TLibeventAsyncManager+0xb1):
>  undefined reference to `event_add'
> {noformat}
> If you add -Wl,--start-group before the event library, OR move event, ssl, 
> and crypto to the end of the library list, the link completes.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to