The dl module seems to cause coredump on Pentium4 boxen when compiled

with gcc 3.3 with a -mcpu or -march flag (even -mcpu=pentiumpro, which
is the default CPU cflag that bsd.cpu.mk sets, leads ruby to coredump).

Although currently I'm not sure if gcc 3.3's optimization has a bug or
it is that it just exposed the dl module's hidden bug, disable those
flags to work around the problem for the moment.
This commit is contained in:
Akinori MUSHA 2003-07-19 16:11:15 +00:00
parent 0cb612164f
commit 004219de73
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=85196
6 changed files with 61 additions and 1 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= ruby${RUBY_R}
PORTVERSION= ${RUBY_PORTVERSION}
PORTREVISION= 1
CATEGORIES= lang ruby ipv6
MASTER_SITES= ${MASTER_SITE_RUBY}
MASTER_SITE_SUBDIR= ${MASTER_SITE_SUBDIR_RUBY}

View file

@ -0,0 +1,19 @@
--- ext/dl/extconf.rb.orig Mon Oct 21 23:52:24 2002
+++ ext/dl/extconf.rb Sun Jul 20 00:55:25 2003
@@ -183,6 +183,16 @@
]
create_makefile('dl')
+
+if (Config::CONFIG['CC'] =~ /gcc/) && (Config::CONFIG['arch'] =~ /i.86/)
+ open('Makefile', 'r+') {|f|
+ s = f.read
+ f.rewind
+ f.print s.gsub(/^(CFLAGS\s*=.*\s)-m(cpu|arch)=\S+/, "\\1")
+ f.truncate f.tell
+ }
+end
+
rescue SystemExit
# do nothing
end

View file

@ -7,6 +7,7 @@
PORTNAME= shim-ruby18
PORTVERSION= 1.8.0.p2.2003.04.19
PORTREVISION= 1
CATEGORIES= lang devel ruby
MASTER_SITES= ${MASTER_SITE_RUBY}
MASTER_SITE_SUBDIR= shim
@ -21,7 +22,7 @@ USE_BZIP2= yes
USE_RUBY= yes
CONFIGURE_ARGS= RUBY=${RUBY}
MAKE_ARGS= RUBY=${RUBY}
#CONFIGURE_ARGS+= CONFIGURE_ARGS="-- --config-opt=--with-opt-dir=${LOCALBASE}"
WRKSRC= ${WRKDIR}/shim/ruby16

View file

@ -0,0 +1,19 @@
--- ext/dl/extconf.rb.orig Mon Oct 21 23:52:24 2002
+++ ext/dl/extconf.rb Sun Jul 20 00:55:25 2003
@@ -183,6 +183,16 @@
]
create_makefile('dl')
+
+if (Config::CONFIG['CC'] =~ /gcc/) && (Config::CONFIG['arch'] =~ /i.86/)
+ open('Makefile', 'r+') {|f|
+ s = f.read
+ f.rewind
+ f.print s.gsub(/^(CFLAGS\s*=.*\s)-m(cpu|arch)=\S+/, "\\1")
+ f.truncate f.tell
+ }
+end
+
rescue SystemExit
# do nothing
end

View file

@ -7,6 +7,7 @@
PORTNAME= ruby${RUBY_R}
PORTVERSION= ${RUBY_PORTVERSION}
PORTREVISION= 1
CATEGORIES= lang ruby ipv6
MASTER_SITES= ${MASTER_SITE_RUBY}
MASTER_SITE_SUBDIR= ${MASTER_SITE_SUBDIR_RUBY}

View file

@ -0,0 +1,19 @@
--- ext/dl/extconf.rb.orig Mon Oct 21 23:52:24 2002
+++ ext/dl/extconf.rb Sun Jul 20 00:55:25 2003
@@ -183,6 +183,16 @@
]
create_makefile('dl')
+
+if (Config::CONFIG['CC'] =~ /gcc/) && (Config::CONFIG['arch'] =~ /i.86/)
+ open('Makefile', 'r+') {|f|
+ s = f.read
+ f.rewind
+ f.print s.gsub(/^(CFLAGS\s*=.*\s)-m(cpu|arch)=\S+/, "\\1")
+ f.truncate f.tell
+ }
+end
+
rescue SystemExit
# do nothing
end