public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] multilib and different CFLAGS for 32 and 64bit ABIs
@ 2015-03-29 18:58 Matthias Schwarzott
  2015-03-29 19:07 ` Matt Turner
  2015-03-29 19:12 ` Matthias Schwarzott
  0 siblings, 2 replies; 6+ messages in thread
From: Matthias Schwarzott @ 2015-03-29 18:58 UTC (permalink / raw
  To: gentoo-dev, blueness

Hi there!

I updated my ~amd64 system recently to new hardware (Intel Core i3-4160).
Since then valgrind did no longer work for 32bit programs because
"-march=native" did choose instructions that valgrind does not support
in 32bit mode (even ld.so was unusable).

After some research I put this into make.conf and now it works:
CFLAGS_x86="${CFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"
CXXFLAGS_x86="${CXXFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"

Is this the best solution to the problem?
If yes, the valgrind ebuild could suggest something like this.
Either always show it or check cpu-flags first (is this maintainable?).

Regards
Matthias


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] multilib and different CFLAGS for 32 and 64bit ABIs
  2015-03-29 18:58 [gentoo-dev] multilib and different CFLAGS for 32 and 64bit ABIs Matthias Schwarzott
@ 2015-03-29 19:07 ` Matt Turner
  2015-03-29 20:07   ` Anthony G. Basile
  2015-03-29 19:12 ` Matthias Schwarzott
  1 sibling, 1 reply; 6+ messages in thread
From: Matt Turner @ 2015-03-29 19:07 UTC (permalink / raw
  To: gentoo-dev; +Cc: Anthony G. Basile

On Sun, Mar 29, 2015 at 11:58 AM, Matthias Schwarzott <zzam@gentoo.org> wrote:
> Hi there!
>
> I updated my ~amd64 system recently to new hardware (Intel Core i3-4160).
> Since then valgrind did no longer work for 32bit programs because
> "-march=native" did choose instructions that valgrind does not support
> in 32bit mode (even ld.so was unusable).
>
> After some research I put this into make.conf and now it works:
> CFLAGS_x86="${CFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"
> CXXFLAGS_x86="${CXXFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"
>
> Is this the best solution to the problem?
> If yes, the valgrind ebuild could suggest something like this.
> Either always show it or check cpu-flags first (is this maintainable?).

Valgrind's policy is that they don't implement new instruction sets in 32-bit.

Doing what you've done is the only option I'm aware of, short of
implementing support in valgrind for these instructions.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] multilib and different CFLAGS for 32 and 64bit ABIs
  2015-03-29 18:58 [gentoo-dev] multilib and different CFLAGS for 32 and 64bit ABIs Matthias Schwarzott
  2015-03-29 19:07 ` Matt Turner
@ 2015-03-29 19:12 ` Matthias Schwarzott
  2015-03-29 21:29   ` Davide Pesavento
  1 sibling, 1 reply; 6+ messages in thread
From: Matthias Schwarzott @ 2015-03-29 19:12 UTC (permalink / raw
  To: gentoo-dev, blueness

On 29.03.2015 20:58, Matthias Schwarzott wrote:
> Hi there!
> 
> I updated my ~amd64 system recently to new hardware (Intel Core i3-4160).
> Since then valgrind did no longer work for 32bit programs because
> "-march=native" did choose instructions that valgrind does not support
> in 32bit mode (even ld.so was unusable).
> 
> After some research I put this into make.conf and now it works:
> CFLAGS_x86="${CFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"
> CXXFLAGS_x86="${CXXFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"
> 
> Is this the best solution to the problem?
> If yes, the valgrind ebuild could suggest something like this.
> Either always show it or check cpu-flags first (is this maintainable?).
> 
I should add, that it seems to break for exactly one package: mariadb

# file /usr/lib32/libmysqlclient.so.18.0.0
/usr/lib32/libmysqlclient.so.18.0.0: ELF 64-bit LSB shared object,
x86-64, version 1 (SYSV), dynamically linked, stripped

After commenting the flags again:
# file /usr/lib32/libmysqlclient.so.18.0.0
/usr/lib32/libmysqlclient.so.18.0.0: ELF 32-bit LSB shared object, Intel
80386, version 1 (SYSV), dynamically linked, stripped

Regards
Matthias



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] multilib and different CFLAGS for 32 and 64bit ABIs
  2015-03-29 19:07 ` Matt Turner
@ 2015-03-29 20:07   ` Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2015-03-29 20:07 UTC (permalink / raw
  To: gentoo-dev

On 03/29/15 15:07, Matt Turner wrote:
> On Sun, Mar 29, 2015 at 11:58 AM, Matthias Schwarzott <zzam@gentoo.org> wrote:
>> Hi there!
>>
>> I updated my ~amd64 system recently to new hardware (Intel Core i3-4160).
>> Since then valgrind did no longer work for 32bit programs because
>> "-march=native" did choose instructions that valgrind does not support
>> in 32bit mode (even ld.so was unusable).
>>
>> After some research I put this into make.conf and now it works:
>> CFLAGS_x86="${CFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"
>> CXXFLAGS_x86="${CXXFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"
>>
>> Is this the best solution to the problem?
>> If yes, the valgrind ebuild could suggest something like this.
>> Either always show it or check cpu-flags first (is this maintainable?).
> Valgrind's policy is that they don't implement new instruction sets in 32-bit.
>
> Doing what you've done is the only option I'm aware of, short of
> implementing support in valgrind for these instructions.
>

This is a known issue.  I could add a pkg_postinst() message, but with 
valgrind, there would be lots of caveats.  Maybe open a bug and we'll 
track the issue in gentoo that way, like the strlen issue and a few 
other valgrind oldies.

-- 
Anthony G. Basile, Ph.D.
Gentoo Linux Developer [Hardened]
E-Mail    : blueness@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] multilib and different CFLAGS for 32 and 64bit ABIs
  2015-03-29 19:12 ` Matthias Schwarzott
@ 2015-03-29 21:29   ` Davide Pesavento
  2015-03-30 11:50     ` Matthias Schwarzott
  0 siblings, 1 reply; 6+ messages in thread
From: Davide Pesavento @ 2015-03-29 21:29 UTC (permalink / raw
  To: gentoo-dev; +Cc: blueness, Michał Górny

On Sun, Mar 29, 2015 at 9:12 PM, Matthias Schwarzott <zzam@gentoo.org> wrote:
> On 29.03.2015 20:58, Matthias Schwarzott wrote:
>> Hi there!
>>
>> I updated my ~amd64 system recently to new hardware (Intel Core i3-4160).
>> Since then valgrind did no longer work for 32bit programs because
>> "-march=native" did choose instructions that valgrind does not support
>> in 32bit mode (even ld.so was unusable).
>>
>> After some research I put this into make.conf and now it works:
>> CFLAGS_x86="${CFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"
>> CXXFLAGS_x86="${CXXFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"
>>
>> Is this the best solution to the problem?
>> If yes, the valgrind ebuild could suggest something like this.
>> Either always show it or check cpu-flags first (is this maintainable?).
>>
> I should add, that it seems to break for exactly one package: mariadb
>

Not only mariadb, there are other known breakages... see
https://bugs.gentoo.org/show_bug.cgi?id=541616#c5

According to mgorny (Cc'ed):
"You are not supposed to touch CFLAGS_x86, ever. That's some magic
stuff that's used in profiles & multilib.eclass."

Regards,
Davide


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] multilib and different CFLAGS for 32 and 64bit ABIs
  2015-03-29 21:29   ` Davide Pesavento
@ 2015-03-30 11:50     ` Matthias Schwarzott
  0 siblings, 0 replies; 6+ messages in thread
From: Matthias Schwarzott @ 2015-03-30 11:50 UTC (permalink / raw
  To: gentoo-dev

On 29.03.2015 23:29, Davide Pesavento wrote:
> On Sun, Mar 29, 2015 at 9:12 PM, Matthias Schwarzott <zzam@gentoo.org> wrote:
>> On 29.03.2015 20:58, Matthias Schwarzott wrote:
>>> Hi there!
>>>
>>> I updated my ~amd64 system recently to new hardware (Intel Core i3-4160).
>>> Since then valgrind did no longer work for 32bit programs because
>>> "-march=native" did choose instructions that valgrind does not support
>>> in 32bit mode (even ld.so was unusable).
>>>
>>> After some research I put this into make.conf and now it works:
>>> CFLAGS_x86="${CFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"
>>> CXXFLAGS_x86="${CXXFLAGS_x86} -mno-avx2 -mno-sse4 -mno-bmi -mno-bmi2"
>>>
>>> Is this the best solution to the problem?
>>> If yes, the valgrind ebuild could suggest something like this.
>>> Either always show it or check cpu-flags first (is this maintainable?).
>>>
>> I should add, that it seems to break for exactly one package: mariadb
>>
> 
> Not only mariadb, there are other known breakages... see
> https://bugs.gentoo.org/show_bug.cgi?id=541616#c5
> 
> According to mgorny (Cc'ed):
> "You are not supposed to touch CFLAGS_x86, ever. That's some magic
> stuff that's used in profiles & multilib.eclass."
> 
I created this bug to track the issue:
https://bugs.gentoo.org/show_bug.cgi?id=545052

Regards
Matthias



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-30 11:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-29 18:58 [gentoo-dev] multilib and different CFLAGS for 32 and 64bit ABIs Matthias Schwarzott
2015-03-29 19:07 ` Matt Turner
2015-03-29 20:07   ` Anthony G. Basile
2015-03-29 19:12 ` Matthias Schwarzott
2015-03-29 21:29   ` Davide Pesavento
2015-03-30 11:50     ` Matthias Schwarzott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox