ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Ivan A. Melnikov" <iv@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: [devel] rpm-macros-cmake vs qt vs gcc vs eiskaltdcpp-qt = segfault?
Date: Sun, 5 Dec 2010 11:58:03 +0300
Message-ID: <20101205115803.59772d75@deimos.localdomain> (raw)

Здравствуйте.

Тут такая история...

Начал падать eiskaltdcpp-qt. Пошёл разбираться, и нашёл, что
это воспроизводится

http://code.google.com/p/eiskaltdc/issues/detail?id=601

Оказалось, что у нас в /usr/lib/rpm/macros.d/cmake есть такие строки:

[...]
cmake .. \\\
    -DCMAKE_SKIP_RPATH:BOOL=yes \\\
    -DCMAKE_BUILD_TYPE=MinSizeRel \\\
    -DCMAKE_C_FLAGS:STRING='%optflags' \\\
    -DCMAKE_CXX_FLAGS:STRING='%optflags' \\\
[...]

Из-за такого BUILD TYPE к аргументам gcc добавляются
CMAKE_C_FLAGS_MINSIZEREL, содержащие -Os, но добавляются *после*
CMAKE_C_FLAGS. Получается, -O2 из %optflags игнорируется и eiskaltdcpp
собирается с -Os.

Почему-то это приводит к segfault'ам. По ссылке выше пишут, что нужно
собирать с теми же флагами, с какими была собрана qt. Я руками раскрыл
%cmake в спеке, удалил строку про BUILD_TYPE и пересобрал пакет -- всё
заработало.

Получается, что:

* стоит собирать все приложения с Qt с теми же флагами, с которыми была
  собрана Qt -- вообще, типичная ситуация для C++, но то, что флаги
  оптимизации влияют на ABI, имхо, проблема;

* наш %cmake частично игнорирует %optflags, что плохо, наверное повесить
  надо.

-- 
WBR,
Ivan A. Melnikov


             reply	other threads:[~2010-12-05  8:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-05  8:58 Ivan A. Melnikov [this message]
2010-12-05  9:27 ` REAL
2010-12-05  9:53   ` Ivan A. Melnikov
2010-12-10 20:48 ` Michael Shigorin

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=20101205115803.59772d75@deimos.localdomain \
    --to=iv@altlinux.org \
    --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