ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: sisyphus@lists.altlinux.org
Subject: Re: [sisyphus] Need help: sam2p не собирается с указанной архитектурой
Date: Mon, 18 Feb 2008 23:18:54 +0300
Message-ID: <20080218201854.GA4730@atlas.home> (raw)
In-Reply-To: <20080218200052.GE30235@wo.int.altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 3446 bytes --]

On Mon, Feb 18, 2008 at 11:00:52PM +0300, Dmitry V. Levin wrote:
> On Tue, Feb 19, 2008 at 01:45:05AM +0600, Michael Pozhidaev wrote:
> > Привет всем!
> > Не могу побороть проблему, из-за которой не получается собрать sam2p.
> > Суть в том, что после 
> > ./configure 
> > make 
> > всё успешно собирается и замечательно работает.
> > Но:
> > при указанной архитектуре CXXFLAGS='-march=i586'
> > сборка очень быстро завершается с ошибкой.
> > Выглядит это так:
> > Compilation started at Tue Feb 19 01:37:44
> > 
> > LANG=C make CXXFLAGS='-march=i586'

Обычно так делать нельзя - указание переменной в вызове make полностью
заменяет значение, установленное в Makefile, тем, которое указано в
командной строке; вероятно, в данном случае в результате были потеряны
нужные для сборки опции.

Стандартный способ - использование макроса %configure, который
передаёт CFLAGS и CXXFLAGS скрипту configure; но у этого пакета
configure какой-то странный (CXXFLAGS грубо чистится).  Возможный
способ обхода - передача CC="gcc $RPM_OPT_FLAGS" CXX="g++
$RPM_OPT_FLAGS" в вызове configure.

> > g++ -s -O2 -march=i586 -ansi -pedantic -Wall -W -c ps_tiny.c
> > ps_tiny.c: In function 'void copy(const char*)':
> > ps_tiny.c:536: warning: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result
> > ps_tiny.c: In function 'void compress0(const char*)':
> > ps_tiny.c:605: warning: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result
> > g++ -s -O2 -march=i586 -ansi -pedantic -Wall -W -c c_lgcc.cpp
> > gcc -s   ps_tiny.o c_lgcc.o -o ps_tiny
> > ps_tiny.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
> > c_lgcc.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
> > collect2: ld returned 1 exit status
> > make: *** [ps_tiny] Error 1
> > 
> > Compilation exited abnormally with code 2 at Tue Feb 19 01:37:45
> > Кто-нибудь видит здесь причину?
> 
> Выбран неправильный фронтенд для линковки приложений на c++.
> Если хотя бы один объектный файл скомпилирован g++, то и линковать следует
> тоже с помощью g++ а не gcc.

Там какой-то странный апстрим - похоже, такую линковку сделали
специально; файл c_lgcc.cpp содержит ужас следующего вида:

/* Tue Sep  3 18:24:26 CEST 2002
 * empirical g++-3.2 helper routines for gcc version 3.2.1 20020830 (Debian prerelease)
 */
void* operator new      XMALLOC_CODE()
void* operator new[]    XMALLOC_CODE()
void  operator delete   XFREE_CODE()
void  operator delete[] XFREE_CODE()
void* __cxa_pure_virtual=0;

Впрочем, c_lgcc3.cpp ещё лучше:

/* at Wed Dec 11 16:31:42 CET 2002
 * This helper is here for gcc-2.95: c_lgcc3.cpp should be compiled by
 * gcc-2.95, remaining files are compiled by g++-3.2
 */
void* __cxa_pure_virtual=0;
extern "C" void  _ZdlPv (void*);
extern "C" void* _Znwj (unsigned);
extern "C" void  _ZdaPv (void*);
extern "C" void* _Znaj (unsigned);
void  _ZdlPv XFREE_CODE()
void* _Znwj  XMALLOC_CODE()
void  _ZdaPv XFREE_CODE()
void* _Znaj  XMALLOC_CODE()

И вот такие перлы в README:

Q31. Why not use libjpeg/libtiff/libpng/zlib or any other library with
     sam2p?

A31. -- library and .h incompatibilities (the binary would be less portable
        across Linux systems)
     -- to avoid forced dependencies
     -- checkergcc wouldn't work



[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-02-18 20:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-18 19:45 Michael Pozhidaev
2008-02-18 20:00 ` Dmitry V. Levin
2008-02-18 20:18   ` Sergey Vlasov [this message]
2008-02-18 21:54     ` Dmitry V. Levin
2008-02-19 10:33       ` Sergey Vlasov
2008-02-18 22:01     ` Michael Pozhidaev
2008-02-18 21:43   ` Michael Pozhidaev

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=20080218201854.GA4730@atlas.home \
    --to=vsu@altlinux.ru \
    --cc=sisyphus@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 Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/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 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

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


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