ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vitty@altlinux.ru>
To: <devel@lists.altlinux.org>
Subject: Re: [devel] /usr/lib64/python2.7/config/libpython2.7.a is WRONG
Date: Mon, 16 Apr 2012 09:01:21 +0400
Message-ID: <7b39c31444540d3b01c11f5c7b7527a8@hadoop.ru> (raw)
In-Reply-To: <1334506417.17690.27.camel@aris_dell.localdomain>

On Sun, 15 Apr 2012 20:13:37 +0400, Yuri N. Sedunov wrote:
> В Вск, 15/04/2012 в 20:07 +0400, Dmitry V. Levin пишет:
>> > > > Ошибка запаковки при переезде на статическую сборку python. По 
>> идее,
>> > > > там вместо неё должен лежать симлинк libpython2.7.so
>> > > > на ../../libpython2.7.so.
>> > > >
>> > > > 2 vitty@: вешать?
>> > >
>> > > Да, повесьте, пожалуйста, завтра исправлю.
>> >
>> > Зачем по-вашему нужен этот симлинк?
>>
>> Там и -L/usr/lib64/python2.7/config не нужен.  Но когда в
>> /usr/lib64/python2.7/config нет библиотек, от этого -L хотя бы вреда 
>> нет.
>>
>
> И здесь надо исправить.
> $ python-config --ldflags
> -L/usr/lib/python2.7/config -lpthread -ldl -lutil -lm -lpython2.7
> -Xlinker -export-dynamic

Не нравится -l или -L? Или обе? :)

Захакать, конечно, можно, но от этого могут сломаться те, кому 
действительно надо линковаться с libpython. В debian, чей подход к 
сборке python мы в том или ином виде пытаемся повторить сейчас сделано 
так:

в /usr/lib{,64}/python2.x/config/ лежат:
файлы пакета python-dev:
libpython2.x.a
libpython2.x-pic.a
файл пакета libpython:
libpython2.x.so -> ../../libpython2.x.so.1

python-config --ldflags:
-L/usr/lib/python2.x/config -lpthread -ldl -lutil -lm -lpython2.x

В python-config логика следующая:
         libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
         libs.append('-lpython'+pyver)
         # add the prefix/lib/pythonX.Y/config dir, but only if there is 
no
         # shared library in prefix/lib/.
         if opt == '--ldflags':
             if not getvar('Py_ENABLE_SHARED'):
                 libs.insert(0, '-L' + getvar('LIBPL'))
             libs.extend(getvar('LINKFORSHARED').split())
         print ' '.join(libs)

т.е. -lpython2.x добавляется всегда, -L/usr/lib{,64}/python2.x/config 
добавляется в случае статической линковки интерпретатора с libpython. У 
нас, насколько я понимаю, пользователей статической libpython2.x.a нет, 
не стоит их и заводить. Стоит, на мой взгляд, красоты ради отучить 
python-config выводить -L/usr/lib{,64}/python2.x/config, -lpython2.x же 
лучше оставить. Или я не прав?


  reply	other threads:[~2012-04-16  5:01 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13 10:36 [devel] Rebuild to remove redundant libpython2.7 dependency Yuri N. Sedunov
2012-04-13 10:56 ` Vitaly Kuznetsov
2012-04-13 11:32   ` Yuri N. Sedunov
2012-04-13 12:18     ` Dmitry V. Levin
2012-04-13 14:39       ` Yuri N. Sedunov
2012-04-13 14:59         ` Vitaly Kuznetsov
2012-04-13 17:02           ` Dmitry V. Levin
2012-04-14  9:17             ` REAL
2012-04-14  9:32               ` Michael Shigorin
2012-04-14 10:43                 ` REAL
2012-04-14 13:24                   ` Michael Shigorin
2012-04-14 11:13               ` Ivan A. Melnikov
2012-04-14 11:55                 ` REAL
2012-04-15  4:58                   ` [devel] /usr/lib64/python2.7/config/libpython2.7.a is WRONG Ivan A. Melnikov
2012-04-15 15:22                     ` Vitaly Kuznetsov
2012-04-15 15:48                       ` Dmitry V. Levin
2012-04-15 15:52                       ` Yuri N. Sedunov
2012-04-15 16:07                         ` Dmitry V. Levin
2012-04-15 16:13                           ` Yuri N. Sedunov
2012-04-16  5:01                             ` Vitaly Kuznetsov [this message]
2012-04-16  5:11                               ` REAL
2012-04-16  6:02                                 ` Vitaly Kuznetsov
2012-04-16  5:18                               ` Yuri N. Sedunov
2012-04-16  5:40                                 ` REAL
2012-04-16  5:54                                   ` Yuri N. Sedunov
2012-04-16  5:58                                     ` REAL
2012-04-16  6:08                                       ` Yuri N. Sedunov
2012-04-16  6:11                                       ` Vitaly Kuznetsov
2012-04-16  6:00                                     ` Vitaly Kuznetsov
2012-04-16  5:58                                 ` Vitaly Kuznetsov
2012-04-16  6:02                                   ` Yuri N. Sedunov
2012-04-16  6:07                                     ` Vitaly Kuznetsov
2012-04-16  6:14                                       ` Yuri N. Sedunov
2012-04-16  6:54                                         ` Vitaly Kuznetsov
2012-04-16  7:13                                           ` Yuri N. Sedunov
2012-04-16  7:25                                             ` Vitaly Kuznetsov
2012-04-16  7:28                                               ` Yuri N. Sedunov
2012-04-16  8:32                                                 ` Vitaly Kuznetsov
2012-04-16 10:08                                     ` Dmitry V. Levin
2012-04-16 19:14                                 ` Ivan A. Melnikov
2012-04-16  9:57                               ` Dmitry V. Levin
2012-04-13 14:35   ` [devel] Rebuild to remove redundant libpython2.7 dependency REAL

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7b39c31444540d3b01c11f5c7b7527a8@hadoop.ru \
    --to=vitty@altlinux.ru \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git