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

2019-04-07 Пенетрантность Maxim Dounin
Hello!

On Sun, Apr 07, 2019 at 10:41:22PM +0300, Igor Sysoev wrote:

> > On 7 Apr 2019, at 22:16, Anton Kiryushkin  wrote:
> > 
> > Я взял код из лога и попробовал его собрать ровно так, как написано.
> > Строка моего configure следующая:
> > ./configure --prefix=/usr --conf-path=/etc/nginx/nginx.conf 
> > --error-log-path=/var/log/nginx/error.log 
> > --http-client-body-temp-path=/var/lib/nginx/body 
> > --http-fastcgi-temp-path=/var/lib/nginx/fastcgi 
> > --http-log-path=/var/log/nginx/access.log 
> > --http-proxy-temp-path=/var/lib/nginx/proxy 
> > --http-scgi-temp-path=/var/lib/nginx/scgi 
> > --http-uwsgi-temp-path=/var/lib/nginx/uwsgi 
> > --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug 
> > --with-http_addition_module --with-http_dav_module --with-http_geoip_module 
> > --with-http_gzip_static_module  --with-http_realip_module 
> > --with-http_stub_status_module --with-http_ssl_module 
> > --with-http_sub_module --with-sha1=/usr/include/openssl 
> > --with-md5=/usr/include/openssl --add-module=/usr/src/naxsi/naxsi_src 
> > --with-debug --with-http_v2_module --with-cc-opt="-static -static-libgcc" 
> > --with-ld-opt="-static -lm" --with-cpu-opt=generic 
> > --with-openssl=./openssl-1.0.2r --with-stream --with-stream_ssl_module 
> > --user=www-data --with-http_image_filter_module
> > 
> > Что-то тут уже устаревшее, но это не очень важно.
> > Выпадает ошибка:
> > checking for GD library ... not found
> > checking for GD library in /usr/local/ ... not found
> > checking for GD library in /usr/pkg/ ... not found
> > checking for GD library in /opt/local/ ... not found
> > 
> > Окей. Берем код автотеста:
> > 
> > #include 
> > #include 
> > #include 
> > 
> > int main(void) {
> > gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);
> >   (void) img;
> > return 0;
> > }
> > 
> > Собираем:
> > cc -static -static-libgcc -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 (строчка из того же лога).
> > Не собирается.
> > Однако, если подвинуть -lm в конец:
> > 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 -lm
> > 
> > Все соберется.
> > 
> > Вопрос, как передвинуть на уровне сборки?
> 
> Штатно не двигается.
> Можно добавить в auto/lib/libgd/conf:
> 
> -   ngx_feature_libs="-L/usr/pkg/lib -lgd"
> +   ngx_feature_libs="-L/usr/pkg/lib -lgd -lm"
> 
> В динамической libgd.so зависимость от libm.so записана,
> а в статической такой возможности нет.

Штатно аналогичный результат можно, если очень хочется, получить так:

./configure --with-http_image_filter_module \
--with-ld-opt="-L/usr/pkg/lib -static -lgd -lm"

Хотя вот лично я бы - не рекомендовал, особенно под Linux'ом.  Там 
warning'и при статической линковке - не просто так, и 
игнорирование их ведёт к вопросам "у меня всё сломалось, что вы 
поменяли в nginx'е" вполне очевидным образом.

Тем более, что у современного GD зависимостей - устанешь 
перечислять, -lm - это только верхушка айсберга.  Скажем, чтобы 
собраться статически со штатным пакетом GD на FreeBSD мне 
потребовалась какая-то такая простыня:

./auto/configure --with-http_image_filter_module \
--with-ld-opt="-L/usr/local/lib -static -lgd -lm \
-lpng -lm -lz -lfontconfig -lfreetype -ljpeg \
-ltiff -lwebp -lexpat -lbz2"

-- 
Maxim Dounin
http://mdounin.ru/
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

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

2019-04-07 Пенетрантность Igor Sysoev
> On 7 Apr 2019, at 22:16, Anton Kiryushkin  wrote:
> 
> Я взял код из лога и попробовал его собрать ровно так, как написано.
> Строка моего configure следующая:
> ./configure --prefix=/usr --conf-path=/etc/nginx/nginx.conf 
> --error-log-path=/var/log/nginx/error.log 
> --http-client-body-temp-path=/var/lib/nginx/body 
> --http-fastcgi-temp-path=/var/lib/nginx/fastcgi 
> --http-log-path=/var/log/nginx/access.log 
> --http-proxy-temp-path=/var/lib/nginx/proxy 
> --http-scgi-temp-path=/var/lib/nginx/scgi 
> --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock 
> --pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module 
> --with-http_dav_module --with-http_geoip_module 
> --with-http_gzip_static_module  --with-http_realip_module 
> --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module 
> --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl 
> --add-module=/usr/src/naxsi/naxsi_src --with-debug --with-http_v2_module 
> --with-cc-opt="-static -static-libgcc" --with-ld-opt="-static -lm" 
> --with-cpu-opt=generic --with-openssl=./openssl-1.0.2r --with-stream 
> --with-stream_ssl_module --user=www-data --with-http_image_filter_module
> 
> Что-то тут уже устаревшее, но это не очень важно.
> Выпадает ошибка:
> checking for GD library ... not found
> checking for GD library in /usr/local/ ... not found
> checking for GD library in /usr/pkg/ ... not found
> checking for GD library in /opt/local/ ... not found
> 
> Окей. Берем код автотеста:
> 
> #include 
> #include 
> #include 
> 
> int main(void) {
> gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);
>   (void) img;
> return 0;
> }
> 
> Собираем:
> cc -static -static-libgcc -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 (строчка из того же лога).
> Не собирается.
> Однако, если подвинуть -lm в конец:
> 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 
> -lm
> 
> Все соберется.
> 
> Вопрос, как передвинуть на уровне сборки?

Штатно не двигается.
Можно добавить в auto/lib/libgd/conf:

-   ngx_feature_libs="-L/usr/pkg/lib -lgd"
+   ngx_feature_libs="-L/usr/pkg/lib -lgd -lm"

В динамической libgd.so зависимость от libm.so записана,
а в статической такой возможности нет.


-- 
Igor Sysoev
http://nginx.com

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

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

2019-04-07 Пенетрантность Anton Kiryushkin
Я взял код из лога и попробовал его собрать ровно так, как написано.
Строка моего configure следующая:
./configure --prefix=/usr --conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-client-body-temp-path=/var/lib/nginx/body
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi
--http-log-path=/var/log/nginx/access.log
--http-proxy-temp-path=/var/lib/nginx/proxy
--http-scgi-temp-path=/var/lib/nginx/scgi
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi
--lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug
--with-http_addition_module --with-http_dav_module --with-http_geoip_module
--with-http_gzip_static_module  --with-http_realip_module
--with-http_stub_status_module --with-http_ssl_module
--with-http_sub_module --with-sha1=/usr/include/openssl
--with-md5=/usr/include/openssl --add-module=/usr/src/naxsi/naxsi_src
--with-debug --with-http_v2_module --with-cc-opt="-static -static-libgcc"
--with-ld-opt="-static -lm" --with-cpu-opt=generic
--with-openssl=./openssl-1.0.2r --with-stream --with-stream_ssl_module
--user=www-data --with-http_image_filter_module

Что-то тут уже устаревшее, но это не очень важно.
Выпадает ошибка:
checking for GD library ... not found
checking for GD library in /usr/local/ ... not found
checking for GD library in /usr/pkg/ ... not found
checking for GD library in /opt/local/ ... not found

Окей. Берем код автотеста:

#include 
#include 
#include 

int main(void) {
gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);
  (void) img;
return 0;
}

Собираем:
cc -static -static-libgcc -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 (строчка из того же лога).
Не собирается.
Однако, если подвинуть -lm в конец:
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 -lm

Все соберется.

Вопрос, как передвинуть на уровне сборки?


вс, 7 апр. 2019 г. в 12:34, Anton Kiryushkin :

> Да, конечно, есть:
>
> # find /usr -type f -name 'libm.a'
> /usr/lib/x86_64-linux-gnu/libm.a
>
> Да, я попробовал поставить -lm перед -static, это мне тоже не помогло.
> К слову, libgd тоже там есть:
> # find /usr -type f -name 'libgd.a'
> /usr/lib/x86_64-linux-gnu/libgd.a
>
> Подскажите, пожалуйста, где эти тесты лежат в исходнике, поправлю
> локально, как обычно это делаю с php.
>
> сб, 6 апр. 2019 г. в 19:22, Igor Sysoev :
>
>> А статическая libm.a есть?
>> Можно попробовать поставить -lm до -static:
>>
>> --with-ld-opt="-lm -static ...
>>
>> --
>> Igor Sysoev
>> http://nginx.com
>>
>> > On 6 Apr 2019, at 14:57, Anton Kiryushkin  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 :
>> > А что в autoconf.err ?
>> >
>> > --
>> > Igor Sysoev
>> > http://nginx.com
>> >
>> > > On 6 Apr 2019, at 14:07, Anton Kiryushkin  wrote:
>> > >
>> > > Добавил и не помогло.
>> > >
>> > > сб, 6 апр. 2019 г. в 11:06, Igor Sysoev :
>> > > > On 6 Apr 2019, at 12:54, Anton Kiryushkin 
>> wrote:
>> > > >
>> > > > Здравствуйте.
>> > > >
>> > > > Подскажите, пожалуйста, почему nginx в данном случае никак не может
>> собраться статически с 

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

2019-04-07 Пенетрантность Anton Kiryushkin
Да, конечно, есть:

# find /usr -type f -name 'libm.a'
/usr/lib/x86_64-linux-gnu/libm.a

Да, я попробовал поставить -lm перед -static, это мне тоже не помогло.
К слову, libgd тоже там есть:
# find /usr -type f -name 'libgd.a'
/usr/lib/x86_64-linux-gnu/libgd.a

Подскажите, пожалуйста, где эти тесты лежат в исходнике, поправлю локально,
как обычно это делаю с php.

сб, 6 апр. 2019 г. в 19:22, Igor Sysoev :

> А статическая libm.a есть?
> Можно попробовать поставить -lm до -static:
>
> --with-ld-opt="-lm -static ...
>
> --
> Igor Sysoev
> http://nginx.com
>
> > On 6 Apr 2019, at 14:57, Anton Kiryushkin  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 :
> > А что в autoconf.err ?
> >
> > --
> > Igor Sysoev
> > http://nginx.com
> >
> > > On 6 Apr 2019, at 14:07, Anton Kiryushkin  wrote:
> > >
> > > Добавил и не помогло.
> > >
> > > сб, 6 апр. 2019 г. в 11:06, Igor Sysoev :
> > > > On 6 Apr 2019, at 12:54, Anton Kiryushkin  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
> > > 

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

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

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

-- 
Igor Sysoev
http://nginx.com

> On 6 Apr 2019, at 14:57, Anton Kiryushkin  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 :
> А что в autoconf.err ?
> 
> -- 
> Igor Sysoev
> http://nginx.com
> 
> > On 6 Apr 2019, at 14:07, Anton Kiryushkin  wrote:
> > 
> > Добавил и не помогло.
> > 
> > сб, 6 апр. 2019 г. в 11:06, Igor Sysoev :
> > > On 6 Apr 2019, at 12:54, Anton Kiryushkin  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@nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx-ru
> > 
> > 
> > -- 
> > Best regards,
> > Anton Kiryushkin
> > 
> > ___
> > nginx-ru mailing list
> > nginx-ru@nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx-ru
> 
> ___
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru
> 
> 
> -- 
> Best regards,
> Anton Kiryushkin
> 

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

2019-04-06 Пенетрантность Anton Kiryushkin
Ситуация очень напоминает предыдущую:

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 :

> А что в autoconf.err ?
>
> --
> Igor Sysoev
> http://nginx.com
>
> > On 6 Apr 2019, at 14:07, Anton Kiryushkin  wrote:
> >
> > Добавил и не помогло.
> >
> > сб, 6 апр. 2019 г. в 11:06, Igor Sysoev :
> > > On 6 Apr 2019, at 12:54, Anton Kiryushkin  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@nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx-ru
> >
> >
> > --
> > Best regards,
> > Anton Kiryushkin
> >
> > ___
> > nginx-ru mailing list
> > nginx-ru@nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx-ru
>
> ___
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru



-- 
Best regards,
Anton Kiryushkin
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

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

2019-04-06 Пенетрантность Igor Sysoev
А что в autoconf.err ?

-- 
Igor Sysoev
http://nginx.com

> On 6 Apr 2019, at 14:07, Anton Kiryushkin  wrote:
> 
> Добавил и не помогло.
> 
> сб, 6 апр. 2019 г. в 11:06, Igor Sysoev :
> > On 6 Apr 2019, at 12:54, Anton Kiryushkin  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@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru
> 
> 
> -- 
> Best regards,
> Anton Kiryushkin
> 
> ___
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

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

2019-04-06 Пенетрантность Anton Kiryushkin
Добавил и не помогло.

сб, 6 апр. 2019 г. в 11:06, Igor Sysoev :

> > On 6 Apr 2019, at 12:54, Anton Kiryushkin  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@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru



-- 
Best regards,
Anton Kiryushkin
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

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

2019-04-06 Пенетрантность Igor Sysoev
> On 6 Apr 2019, at 12:54, Anton Kiryushkin  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@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

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

2019-04-06 Пенетрантность Anton Kiryushkin
Здравствуйте.

Подскажите, пожалуйста, почему 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. К сожалению, мне
действительно нужна статическая сборка. Остается страдать и все же так не
делать или есть способ что-то тут сделать?

-- 
Best regards,
Anton Kiryushkin
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru