Re: Статическая сборка nginx с GD

Igor Sysoev igor на sysoev.ru
Сб Апр 6 18:22:09 UTC 2019


А статическая libm.a есть?
Можно попробовать поставить -lm до -static:

--with-ld-opt="-lm -static ...

-- 
Igor Sysoev
http://nginx.com

> On 6 Apr 2019, at 14:57, Anton Kiryushkin <swood at fotofor.biz> wrote:
> 
> Ситуация очень напоминает предыдущую:
> 
> cc -static -static-libgcc -lm -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I /usr/pkg/include -o objs/autotest objs/autotest.c -static -lm -L/usr/pkg/lib -lgd
> ----------
> 
> ----------------------------------------
> checking for GD library in /opt/local/
> 
> /opt/local/lib/libgd.a(gd.o): In function `lsqrt':
> /usr/src/libgd/src/gd.c:1722: undefined reference to `sqrt'
> /opt/local/lib/libgd.a(gd.o): In function `gdImageDashedLine':
> /usr/src/libgd/src/gd.c:1471: undefined reference to `atan2'
> /usr/src/libgd/src/gd.c:1471: undefined reference to `sin'
> /usr/src/libgd/src/gd.c:1520: undefined reference to `atan2'
> /usr/src/libgd/src/gd.c:1520: undefined reference to `sin'
> /opt/local/lib/libgd.a(gd.o): In function `gdImageAALine':
> /usr/src/libgd/src/gd.c:3514: undefined reference to `atan2'
> /usr/src/libgd/src/gd.c:3514: undefined reference to `cos'
> /opt/local/lib/libgd.a(gd.o): In function `gdImageLine':
> /usr/src/libgd/src/gd.c:1394: undefined reference to `atan2'
> /usr/src/libgd/src/gd.c:1394: undefined reference to `sin'
> /usr/src/libgd/src/gd.c:1333: undefined reference to `atan2'
> /usr/src/libgd/src/gd.c:1333: undefined reference to `cos'
> /opt/local/lib/libgd.a(gd.o): In function `gdImageAALine':
> /usr/src/libgd/src/gd.c:3514: undefined reference to `atan2'
> /usr/src/libgd/src/gd.c:3514: undefined reference to `sin'
> /opt/local/lib/libgd.a(gd.o): In function `gdImageCopyRotated':
> /usr/src/libgd/src/gd.c:2792: undefined reference to `sincos'
> /usr/src/libgd/src/gd.c:2791: undefined reference to `sqrt'
> collect2: error: ld returned 1 exit status
> ----------
> 
> Версия nginx 1.15.10. gcc version 4.8.2. 
> 
> сб, 6 апр. 2019 г. в 12:14, Igor Sysoev <igor at sysoev.ru>:
> А что в autoconf.err ?
> 
> -- 
> Igor Sysoev
> http://nginx.com
> 
> > On 6 Apr 2019, at 14:07, Anton Kiryushkin <swood at fotofor.biz> wrote:
> > 
> > Добавил и не помогло.
> > 
> > сб, 6 апр. 2019 г. в 11:06, Igor Sysoev <igor at sysoev.ru>:
> > > On 6 Apr 2019, at 12:54, Anton Kiryushkin <swood at fotofor.biz> wrote:
> > > 
> > > Здравствуйте.
> > > 
> > > Подскажите, пожалуйста, почему nginx в данном случае никак не может собраться статически с libgd:
> > > 
> > > ----------
> > > cc -static -static-libgcc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I /usr/pkg/include -o objs/autotest objs/autotest.c -static -L/usr/pkg/lib -lgd
> > > ----------
> > > 
> > > ----------------------------------------
> > > checking for GD library in /opt/local/
> > > 
> > > /opt/local/lib/libgd.a(gd.o): In function `lsqrt':
> > > /usr/src/libgd/src/gd.c:1722: undefined reference to `sqrt'
> > > /opt/local/lib/libgd.a(gd.o): In function `gdImageDashedLine':
> > > /usr/src/libgd/src/gd.c:1471: undefined reference to `atan2'
> > > /usr/src/libgd/src/gd.c:1471: undefined reference to `sin'
> > > /usr/src/libgd/src/gd.c:1520: undefined reference to `atan2'
> > > /usr/src/libgd/src/gd.c:1520: undefined reference to `sin'
> > > /opt/local/lib/libgd.a(gd.o): In function `gdImageAALine':
> > > /usr/src/libgd/src/gd.c:3514: undefined reference to `atan2'
> > > /usr/src/libgd/src/gd.c:3514: undefined reference to `cos'
> > > /opt/local/lib/libgd.a(gd.o): In function `gdImageLine':
> > > /usr/src/libgd/src/gd.c:1394: undefined reference to `atan2'
> > > /usr/src/libgd/src/gd.c:1394: undefined reference to `sin'
> > > /usr/src/libgd/src/gd.c:1333: undefined reference to `atan2'
> > > /usr/src/libgd/src/gd.c:1333: undefined reference to `cos'
> > > /opt/local/lib/libgd.a(gd.o): In function `gdImageAALine':
> > > /usr/src/libgd/src/gd.c:3514: undefined reference to `atan2'
> > > /usr/src/libgd/src/gd.c:3514: undefined reference to `sin'
> > > /opt/local/lib/libgd.a(gd.o): In function `gdImageCopyRotated':
> > > /usr/src/libgd/src/gd.c:2792: undefined reference to `sincos'
> > > /usr/src/libgd/src/gd.c:2791: undefined reference to `sqrt'
> > > collect2: error: ld returned 1 exit status
> > > ----------
> > > 
> > > Сам libgd собран в  /opt/local с флагом static. К сожалению, мне действительно нужна статическая сборка. Остается страдать и все же так не делать или есть способ что-то тут сделать?
> > 
> > Нужно добавить "-lm" в --with-ld-opt
> > 
> > 
> > -- 
> > Igor Sysoev
> > http://nginx.com
> > _______________________________________________
> > nginx-ru mailing list
> > nginx-ru at nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx-ru
> > 
> > 
> > -- 
> > Best regards,
> > Anton Kiryushkin
> > 
> > _______________________________________________
> > nginx-ru mailing list
> > nginx-ru at nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx-ru
> 
> _______________________________________________
> nginx-ru mailing list
> nginx-ru at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru
> 
> 
> -- 
> Best regards,
> Anton Kiryushkin
> 
> _______________________________________________
> nginx-ru mailing list
> nginx-ru at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru



Подробная информация о списке рассылки nginx-ru