Re: Link error building haproxy-1.9.7

2019-05-10 Thread Willy Tarreau
On Thu, May 09, 2019 at 08:59:44PM +, Chris Packham wrote:
> >>haproxy-1.9.7/src/fd.c:267: undefined reference to `__ha_cas_dw'
(...)
> >>collect2: error: ld returned 1 exit status
> >>Makefile:994: recipe for target 'haproxy' failed
> >>make: *** [haproxy] Error 1
> >>
> >> Eyeballing the code I think it's because USE_THREAD is not defined and
> >> __ha_cas_dw is only defined when USE_THREAD is defined
(...)

> Here's the full make invocation (MUA wrapped unfortunately)
> 
> make -j32 -l16 CC=arm-unknown-linux-gnueabihf-gcc 
> LD=arm-unknown-linux-gnueabihf-gcc 
> DESTDIR=output/armv7/haproxy/new/install PREFIX=/usr CFLAGS=-"O2 -g2 
> -mtune=cortex-a9 -march=armv7-a -mabi=aapcs-linux 
> --sysroot=output/armv7/haproxy/staging 
> LDFLAGS=--sysroot=output/armv7/haproxy/staging USE_OPENSSL=1 
> SSL_INC=output/armv7/haproxy/staging/usr/include 
> SSL_LIB=output/armv7/haproxy/staging/usr/lib TARGET=linux26

Oh you're absolutely right. I build my arm versions with threads by
default and I didn't notice this one. I can obviously reproduce it
as well. The problem doesn't happen on x86_64 because it has the
macro HA_CAS_IS_8B defined and it can fall back to the regular CAS
macro which is implemented in this case. We should have a higher
level HA_CAS_DW function that supports absence of threads and use
this one instead. I'll double-check with Olivier.

Thanks,
Willy



Re: Link error building haproxy-1.9.7

2019-05-09 Thread Chris Packham
On 9/05/19 9:50 PM, William Lallemand wrote:
> On Thu, May 09, 2019 at 03:52:45AM +, Chris Packham wrote:
>> Hi,
>>
>> I'm encountering the following linker error when building haproxy-1.9.7
>>
>> make CC=arm-softfloat-linux-gnueabi USE_OPENSSL=1
>> ...
>> LD  haproxy
>>   
>> /usr/bin/../lib/gcc/arm-softfloat-linux-gnueabi/8.3.0/../../../../arm-softfloat-linux-gnueabi/bin/ld:
>> src/fd.o: in function `fd_rm_from_fd_list':
>>haproxy-1.9.7/src/fd.c:267: undefined reference to `__ha_cas_dw'
>>collect2: error: ld returned 1 exit status
>>Makefile:994: recipe for target 'haproxy' failed
>>make: *** [haproxy] Error 1
>>
>> Eyeballing the code I think it's because USE_THREAD is not defined and
>> __ha_cas_dw is only defined when USE_THREAD is defined
>>
>>
> 
> HAProxy is not supposed to build without a TARGET argument, I can't reproduce
> your problem, what is your complete make line?
> 

Here's the full make invocation (MUA wrapped unfortunately)

make -j32 -l16 CC=arm-unknown-linux-gnueabihf-gcc 
LD=arm-unknown-linux-gnueabihf-gcc 
DESTDIR=output/armv7/haproxy/new/install PREFIX=/usr CFLAGS=-"O2 -g2 
-mtune=cortex-a9 -march=armv7-a -mabi=aapcs-linux 
--sysroot=output/armv7/haproxy/staging 
LDFLAGS=--sysroot=output/armv7/haproxy/staging USE_OPENSSL=1 
SSL_INC=output/armv7/haproxy/staging/usr/include 
SSL_LIB=output/armv7/haproxy/staging/usr/lib TARGET=linux26





Re: Link error building haproxy-1.9.7

2019-05-09 Thread William Lallemand
On Thu, May 09, 2019 at 03:52:45AM +, Chris Packham wrote:
> Hi,
> 
> I'm encountering the following linker error when building haproxy-1.9.7
> 
>make CC=arm-softfloat-linux-gnueabi USE_OPENSSL=1
>...
>LD  haproxy
>  
> /usr/bin/../lib/gcc/arm-softfloat-linux-gnueabi/8.3.0/../../../../arm-softfloat-linux-gnueabi/bin/ld:
>  
> src/fd.o: in function `fd_rm_from_fd_list':
>   haproxy-1.9.7/src/fd.c:267: undefined reference to `__ha_cas_dw'
>   collect2: error: ld returned 1 exit status
>   Makefile:994: recipe for target 'haproxy' failed
>   make: *** [haproxy] Error 1
> 
> Eyeballing the code I think it's because USE_THREAD is not defined and 
> __ha_cas_dw is only defined when USE_THREAD is defined
> 
> 

HAProxy is not supposed to build without a TARGET argument, I can't reproduce
your problem, what is your complete make line?

-- 
William Lallemand