Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 951184 - dev-lang/ruby: Ruby Fails to Build with -march=native
Summary: dev-lang/ruby: Ruby Fails to Build with -march=native
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal major
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-12 07:13 UTC by InfiTekPPC
Modified: 2025-03-13 10:57 UTC (History)
2 users (show)

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


Attachments
emerge --info (emerge_info.txt,6.18 KB, text/plain)
2025-03-12 10:20 UTC, InfiTekPPC
Details
Ruby 2.4.6-r4 Build Log (build.log,72.43 KB, application/octet-stream)
2025-03-12 10:26 UTC, InfiTekPPC
Details

Note You need to log in before you can comment on or make changes to this bug.
Description InfiTekPPC 2025-03-12 07:13:07 UTC
When compiling ruby 3.2.6-r4 it produces this segfault error:

aarch64-unknown-linux-gnu-gcc -march=native -O2 -pipe -fno-omit-frame-pointer -fno-strict-aliasing -fPIC  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mbranch-protection=pac-ret -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -I. -I.ext/include/aarch64-linux -I./include -I. -I./enc/unicode/15.0.0      -o enc/unicode.o -c enc/unicode.c
aarch64-unknown-linux-gnu-gcc -march=native -O2 -pipe -fno-omit-frame-pointer -fno-strict-aliasing -fPIC  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mbranch-protection=pac-ret -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -I. -I.ext/include/aarch64-linux -I./include -I. -I./enc/unicode/15.0.0      -o enc/utf_8.o -c enc/utf_8.c
aarch64-unknown-linux-gnu-gcc -march=native -O2 -pipe -fno-omit-frame-pointer -fno-strict-aliasing -fPIC  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mbranch-protection=pac-ret -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -I. -I.ext/include/aarch64-linux -I./include -I. -I./enc/unicode/15.0.0      -o enc/trans/newline.o -c enc/trans/newline.c
aarch64-unknown-linux-gnu-gcc -march=native -O2 -pipe -fno-omit-frame-pointer -fno-strict-aliasing -fPIC  -L. -Wl,-O1 -Wl,--as-needed -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -fstack-protector-strong -Wl,-O1 -Wl,--as-needed main.o dmydln.o miniinit.o dmyext.o array.o ast.o bignum.o class.o compar.o compile.o complex.o cont.o debug.o debug_counter.o dir.o dln_find.o encoding.o enum.o enumerator.o error.o eval.o file.o gc.o hash.o inits.o io.o io_buffer.o iseq.o load.o marshal.o math.o memory_view.o mjit.o mjit_c.o node.o numeric.o object.o pack.o parse.o proc.o process.o ractor.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o scheduler.o shape.o signal.o sprintf.o st.o strftime.o string.o struct.o symbol.o thread.o time.o transcode.o transient_heap.o util.o variable.o version.o vm.o vm_backtrace.o vm_dump.o vm_sync.o vm_trace.o  coroutine/arm64/Context.o  enc/ascii.o enc/us_ascii.o enc/unicode.o enc/utf_8.o enc/trans/newline.o setproctitle.o addr2line.o   -lz -lrt -lrt -lgmp -ldl -lcrypt -lm -lpthread  -lm -lpthread   -o miniruby
:
./miniruby -I./lib -I. -I.ext/common  -n \
-e 'BEGIN{version=ARGV.shift;mis=ARGV.dup}' \
-e 'END{abort "UNICODE version mismatch: #{mis}" unless mis.empty?}' \
-e '(mis.delete(ARGF.path); ARGF.close) if /ONIG_UNICODE_VERSION_STRING +"#{Regexp.quote(version)}"/o' \
15.0.0 ./enc/unicode/15.0.0/casefold.h ./enc/unicode/15.0.0/name2ctype.h
./miniruby -I./lib -I. -I.ext/common  ./tool/generic_erb.rb -o builtin_binary.inc \
	./template/builtin_binary.inc.tmpl -- --cross=no
make: *** [uncommon.mk:879: .rbconfig.time] Segmentation fault
make: *** Waiting for unfinished jobs....
make: *** [uncommon.mk:1217: builtin_binary.inc] Segmentation fault

However, the build passes with flying colors when injecting CFLAGS="-O2"
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-12 07:17:32 UTC
How about 3.2.7? Please also include the full build.log and emerge --info.

Also, what does -march=native expand to for you?
Comment 2 InfiTekPPC 2025-03-12 10:20:00 UTC
Created attachment 920606 [details]
emerge --info
Comment 3 InfiTekPPC 2025-03-12 10:26:13 UTC
Created attachment 920607 [details]
Ruby 2.4.6-r4 Build Log
Comment 4 InfiTekPPC 2025-03-12 10:28:32 UTC
(In reply to Sam James from comment #1)
> How about 3.2.7? Please also include the full build.log and emerge --info.
> 
> Also, what does -march=native expand to for you?

armv8-a+flagm+lse+dotprod+rdma+crc+aes+sha3+fp16fml+rcpc+sb+ssbs+pauth

As for 3.2.7, i will attempt to build that version after LibreWolf finishes, and will post the build.log and results