diff mbox

package/tn5250: fix static linking problem

Message ID 1440579591-23594-1-git-send-email-Vincent.Riera@imgtec.com
State Superseded
Headers show

Commit Message

Vicente Olivert Riera Aug. 26, 2015, 8:59 a.m. UTC
tn5250 fails to link with openssl when building statically. We need to
add the needed libraries to the LIBS configure environment variable in
order to make tn5250 able to find them.

Fixes:

  http://autobuild.buildroot.net/results/95f/95f6df0d01e4944ecd84e830e2bbd8389e1d3e3d/

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
 package/tn5250/tn5250.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Baruch Siach Aug. 26, 2015, 9:08 a.m. UTC | #1
Hi Vicente,

On Wed, Aug 26, 2015 at 09:59:51AM +0100, Vicente Olivert Riera wrote:
> tn5250 fails to link with openssl when building statically. We need to
> add the needed libraries to the LIBS configure environment variable in
> order to make tn5250 able to find them.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/95f/95f6df0d01e4944ecd84e830e2bbd8389e1d3e3d/
> 
> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> ---
>  package/tn5250/tn5250.mk |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/package/tn5250/tn5250.mk b/package/tn5250/tn5250.mk
> index 213f02c..953b395 100644
> --- a/package/tn5250/tn5250.mk
> +++ b/package/tn5250/tn5250.mk
> @@ -12,6 +12,7 @@ TN5250_LICENSE = LGPLv2.1+
>  TN5250_LICENSE_FILES = COPYING
>  
>  ifeq ($(BR2_PACKAGE_OPENSSL),y)
> +TN5250_CONF_ENV += LIBS="-lssl -lcrypto -lz"

Please use pkg-config. See package/vsftpd/vsftpd.mk for example.

>  TN5250_CONF_OPTS += --with-ssl-dir=$(STAGING_DIR)/usr
>  TN5250_DEPENDENCIES += openssl
>  else

baruch
Vicente Olivert Riera Aug. 26, 2015, 9:09 a.m. UTC | #2
Dear Baruch Siach,

On 08/26/2015 10:08 AM, Baruch Siach wrote:
> Hi Vicente,
> 
> On Wed, Aug 26, 2015 at 09:59:51AM +0100, Vicente Olivert Riera wrote:
>> tn5250 fails to link with openssl when building statically. We need to
>> add the needed libraries to the LIBS configure environment variable in
>> order to make tn5250 able to find them.
>>
>> Fixes:
>>
>>   http://autobuild.buildroot.net/results/95f/95f6df0d01e4944ecd84e830e2bbd8389e1d3e3d/
>>
>> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
>> ---
>>  package/tn5250/tn5250.mk |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/package/tn5250/tn5250.mk b/package/tn5250/tn5250.mk
>> index 213f02c..953b395 100644
>> --- a/package/tn5250/tn5250.mk
>> +++ b/package/tn5250/tn5250.mk
>> @@ -12,6 +12,7 @@ TN5250_LICENSE = LGPLv2.1+
>>  TN5250_LICENSE_FILES = COPYING
>>  
>>  ifeq ($(BR2_PACKAGE_OPENSSL),y)
>> +TN5250_CONF_ENV += LIBS="-lssl -lcrypto -lz"
> 
> Please use pkg-config. See package/vsftpd/vsftpd.mk for example.

that was my first approach and it didn't work. Does it work for you?

Regards,

Vincent.

>>  TN5250_CONF_OPTS += --with-ssl-dir=$(STAGING_DIR)/usr
>>  TN5250_DEPENDENCIES += openssl
>>  else
> 
> baruch
>
Baruch Siach Aug. 26, 2015, 10:32 a.m. UTC | #3
Hi vincente,

On Wed, Aug 26, 2015 at 10:09:31AM +0100, Vicente Olivert Riera wrote:
> On 08/26/2015 10:08 AM, Baruch Siach wrote:
> > On Wed, Aug 26, 2015 at 09:59:51AM +0100, Vicente Olivert Riera wrote:
> >>  ifeq ($(BR2_PACKAGE_OPENSSL),y)
> >> +TN5250_CONF_ENV += LIBS="-lssl -lcrypto -lz"
> > 
> > Please use pkg-config. See package/vsftpd/vsftpd.mk for example.
> 
> that was my first approach and it didn't work. Does it work for you?

Please try http://patchwork.ozlabs.org/patch/510797/. Works for me :-).

baruch
Vicente Olivert Riera Aug. 26, 2015, 11:04 a.m. UTC | #4
Dear Baruch Siach,

On 08/26/2015 11:32 AM, Baruch Siach wrote:
> Hi vincente,
> 
> On Wed, Aug 26, 2015 at 10:09:31AM +0100, Vicente Olivert Riera wrote:
>> On 08/26/2015 10:08 AM, Baruch Siach wrote:
>>> On Wed, Aug 26, 2015 at 09:59:51AM +0100, Vicente Olivert Riera wrote:
>>>>  ifeq ($(BR2_PACKAGE_OPENSSL),y)
>>>> +TN5250_CONF_ENV += LIBS="-lssl -lcrypto -lz"
>>>
>>> Please use pkg-config. See package/vsftpd/vsftpd.mk for example.
>>
>> that was my first approach and it didn't work. Does it work for you?
> 
> Please try http://patchwork.ozlabs.org/patch/510797/. Works for me :-).
> 
> baruch
> 

yeah, that one works. I was missing "libcrypto". But, I don't understand
why do you need to put libcrypto manually since it's already listed in
the openssl.pc file, and then libcrypto pulls libz. Doesn't work
recursively?

Regards,

Vincent.
Baruch Siach Aug. 26, 2015, 11:12 a.m. UTC | #5
Hi Vicente,

On Wed, Aug 26, 2015 at 12:04:09PM +0100, Vicente Olivert Riera wrote:
> On 08/26/2015 11:32 AM, Baruch Siach wrote:
> > On Wed, Aug 26, 2015 at 10:09:31AM +0100, Vicente Olivert Riera wrote:
> >> On 08/26/2015 10:08 AM, Baruch Siach wrote:
> >>> On Wed, Aug 26, 2015 at 09:59:51AM +0100, Vicente Olivert Riera wrote:
> >>>>  ifeq ($(BR2_PACKAGE_OPENSSL),y)
> >>>> +TN5250_CONF_ENV += LIBS="-lssl -lcrypto -lz"
> >>>
> >>> Please use pkg-config. See package/vsftpd/vsftpd.mk for example.
> >>
> >> that was my first approach and it didn't work. Does it work for you?
> > 
> > Please try http://patchwork.ozlabs.org/patch/510797/. Works for me :-).
> 
> yeah, that one works. I was missing "libcrypto". But, I don't understand
> why do you need to put libcrypto manually since it's already listed in
> the openssl.pc file, and then libcrypto pulls libz. Doesn't work
> recursively?

I tried "--libs openssl" here, and it works as well. I'm not sure which one is 
better.

baruch
Vicente Olivert Riera Aug. 26, 2015, 11:29 a.m. UTC | #6
Dear Baruch Siach,

On 08/26/2015 12:12 PM, Baruch Siach wrote:
> Hi Vicente,
> 
> On Wed, Aug 26, 2015 at 12:04:09PM +0100, Vicente Olivert Riera wrote:
>> On 08/26/2015 11:32 AM, Baruch Siach wrote:
>>> On Wed, Aug 26, 2015 at 10:09:31AM +0100, Vicente Olivert Riera wrote:
>>>> On 08/26/2015 10:08 AM, Baruch Siach wrote:
>>>>> On Wed, Aug 26, 2015 at 09:59:51AM +0100, Vicente Olivert Riera wrote:
>>>>>>  ifeq ($(BR2_PACKAGE_OPENSSL),y)
>>>>>> +TN5250_CONF_ENV += LIBS="-lssl -lcrypto -lz"
>>>>>
>>>>> Please use pkg-config. See package/vsftpd/vsftpd.mk for example.
>>>>
>>>> that was my first approach and it didn't work. Does it work for you?
>>>
>>> Please try http://patchwork.ozlabs.org/patch/510797/. Works for me :-).
>>
>> yeah, that one works. I was missing "libcrypto". But, I don't understand
>> why do you need to put libcrypto manually since it's already listed in
>> the openssl.pc file, and then libcrypto pulls libz. Doesn't work
>> recursively?
> 
> I tried "--libs openssl" here, and it works as well. I'm not sure which one is 
> better.
> 
> baruch
> 

indeed, it works. Now I'm wondering which which mistake I made.

I think just "--libs openssl" is better since it seems to act
recursively and pull all the other libraries as well. If you send a v2
of your patch, you can keep my reviewed-by and my tested-by, since I
have already done the test.

Regards,

Vincent.
Vicente Olivert Riera Aug. 26, 2015, 11:32 a.m. UTC | #7
Dear Baruch Siach,

On 08/26/2015 12:29 PM, Vicente Olivert Riera wrote:
> I think just "--libs openssl" is better since it seems to act
> recursively

look at this snippet from config.log:

ac_cv_env_LIBS_value='-lssl
-L/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr//lib
-lcrypto -lz  '

So, it does recursion.

Regards,

Vincent.
Baruch Siach Aug. 26, 2015, 11:39 a.m. UTC | #8
Hi Vicente,

On Wed, Aug 26, 2015 at 12:29:28PM +0100, Vicente Olivert Riera wrote:
> On 08/26/2015 12:12 PM, Baruch Siach wrote:
> > On Wed, Aug 26, 2015 at 12:04:09PM +0100, Vicente Olivert Riera wrote:
> >> On 08/26/2015 11:32 AM, Baruch Siach wrote:
> >>> On Wed, Aug 26, 2015 at 10:09:31AM +0100, Vicente Olivert Riera wrote:
> >>>> On 08/26/2015 10:08 AM, Baruch Siach wrote:
> >>>>> On Wed, Aug 26, 2015 at 09:59:51AM +0100, Vicente Olivert Riera wrote:
> >>>>>>  ifeq ($(BR2_PACKAGE_OPENSSL),y)
> >>>>>> +TN5250_CONF_ENV += LIBS="-lssl -lcrypto -lz"
> >>>>>
> >>>>> Please use pkg-config. See package/vsftpd/vsftpd.mk for example.
> >>>>
> >>>> that was my first approach and it didn't work. Does it work for you?
> >>>
> >>> Please try http://patchwork.ozlabs.org/patch/510797/. Works for me :-).
> >>
> >> yeah, that one works. I was missing "libcrypto". But, I don't understand
> >> why do you need to put libcrypto manually since it's already listed in
> >> the openssl.pc file, and then libcrypto pulls libz. Doesn't work
> >> recursively?
> > 
> > I tried "--libs openssl" here, and it works as well. I'm not sure which one is 
> > better.
> 
> indeed, it works. Now I'm wondering which which mistake I made.
> 
> I think just "--libs openssl" is better since it seems to act
> recursively and pull all the other libraries as well. If you send a v2
> of your patch, you can keep my reviewed-by and my tested-by, since I
> have already done the test.

Just did.

Thanks,
baruch
Peter Korsgaard Aug. 26, 2015, 9:26 p.m. UTC | #9
>>>>> "Vicente" == Vicente Olivert Riera <Vincent.Riera@imgtec.com> writes:

Hi,

 > yeah, that one works. I was missing "libcrypto". But, I don't understand
 > why do you need to put libcrypto manually since it's already listed in
 > the openssl.pc file, and then libcrypto pulls libz. Doesn't work
 > recursively?

It should when linking statically. Make sure you pass --static to
pkg-conf (like we do in BR).
diff mbox

Patch

diff --git a/package/tn5250/tn5250.mk b/package/tn5250/tn5250.mk
index 213f02c..953b395 100644
--- a/package/tn5250/tn5250.mk
+++ b/package/tn5250/tn5250.mk
@@ -12,6 +12,7 @@  TN5250_LICENSE = LGPLv2.1+
 TN5250_LICENSE_FILES = COPYING
 
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
+TN5250_CONF_ENV += LIBS="-lssl -lcrypto -lz"
 TN5250_CONF_OPTS += --with-ssl-dir=$(STAGING_DIR)/usr
 TN5250_DEPENDENCIES += openssl
 else