Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 270098 - sys-freebsd/freebsd-lib-7.1: miscompilation with gcc 4.4 without -fno-strict-aliasing
Summary: sys-freebsd/freebsd-lib-7.1: miscompilation with gcc 4.4 without -fno-strict-...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All Linux
: High normal (vote)
Deadline: 2019-10-11
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords: PMASKED
Depends on:
Blocks:
 
Reported: 2009-05-16 19:48 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2019-10-11 15:18 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2009-05-16 19:48:30 UTC
gfbsd sh # echo -e "a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm" | awk '{ print NR-1 }'
0
1
2
3
4
5
6
7
8
9
10
10.0000000000000000000000000000
10.0000000000000000000000000000
gfbsd sh # echo -e "a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm" | awk '{ print NR }'
1
2
3
4
5
6
7
8
9
10
10.0000000000000000000000000000
10.0000000000000000000000000000
10.0000000000000000000000000000
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-05-16 20:16:25 UTC
Fun, seems like the copy of gawk that I have on the same system behaves the same way. Not nice at all. Can somebody confirm/deny this? If it's only me I'd blame QEmu/KVM..
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-05-16 21:29:52 UTC
Seems like there is a miscompilation in the FreeBSD C library when using GCC 4.4, I'm marking GCC 4.4 -x86-fbsd for now, we can find the cause later maybe..
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-05-16 21:32:58 UTC
Reduced testcase to show where the problem is...

gfbsd ~ # cat test.c
#include <stdio.h>

int main() {
        printf("%f\n", 11.0);
}
gfbsd ~ # gcc test.c -o test
gfbsd ~ # ./test
;0.000000

[this causes strange effects on the original awk, gawk behaves slightly differently and outputs ;0 directly...]
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-05-16 21:51:14 UTC
After looking around it seems like it's a variation of the problem reported to me by Alexander Patrakov before:

http://blog.flameeyes.eu/2009/03/09/you-should-refuse-stable
http://bugs.debian.org/518927
http://patrakov.blogspot.com/2009/03/dont-use-old-dtoac.html
Comment 5 Alexis Ballier gentoo-dev 2009-09-19 23:37:19 UTC
I've appended -fno-strict-aliasing and rekeyworded gcc 4.4 so that we can move on.
Let's keep this open until it's really fixed.
Comment 6 Richard Yao (RETIRED) gentoo-dev 2012-07-19 15:29:48 UTC
I cannot reproduce this with sys-freebsd/freebsd-lib-9.0 and either GCC 4.6 or Clang 3.1. Are there any objections to removing -fno-strict-aliasing from the ebuild?
Comment 7 Richard Yao (RETIRED) gentoo-dev 2012-07-19 15:35:25 UTC
We need to test this on x86. Right now, I only have amd64 setup. I will setup an x86 jail later to test this.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-09-11 12:14:31 UTC
sys-freebsd/* is now pmasked.
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-10-11 15:18:04 UTC
sys-freebsd/* removed.