Opened 11 years ago

Last modified 11 years ago

#37740 closed defect

webkit-gtk @1.10.2: undefined method `getbyte' — at Initial Version

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: tiger leopard haspatch Cc: devans@…
Port: webkit-gtk

Description

After applying the patch from #37418 to get past the error in Leopard's system headers, the build fails with:

libtool: link: /usr/bin/g++-4.2 -pipe -O2 -arch i386 -O2 -arch i386 -o Programs/LLIntOffsetsExtractor Source/JavaScriptCore/llint/Programs_LLIntOffsetsExtractor-LLIntOffsetsExtractor.o  -L/opt/local/lib ./.libs/libWTF.a -licui18n -licuuc -licudata /opt/local/lib/libgio-2.0.dylib /opt/local/lib/libgmodule-2.0.dylib -lz /opt/local/lib/libgobject-2.0.dylib /opt/local/lib/libgthread-2.0.dylib /opt/local/lib/libffi.dylib /opt/local/lib/libglib-2.0.dylib -lresolv /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -lc -lm -lpthread -lstdc++
/usr/bin/ruby ./Source/JavaScriptCore/offlineasm/asm.rb ./Source/JavaScriptCore/llint/LowLevelInterpreter.asm Programs/LLIntOffsetsExtractor DerivedSources/JavaScriptCore/LLIntAssembly.h
offlineasm: Parsing ./Source/JavaScriptCore/llint/LowLevelInterpreter.asm and Programs/LLIntOffsetsExtractor and creating assembly file DerivedSources/JavaScriptCore/LLIntAssembly.h.
./Source/JavaScriptCore/offlineasm/offsets.rb:112:in `offsetsAndConfigurationIndex': undefined method `getbyte' for #<File:Programs/LLIntOffsetsExtractor (closed)> (NoMethodError)
	from ./Source/JavaScriptCore/offlineasm/offsets.rb:111:in `loop'
	from ./Source/JavaScriptCore/offlineasm/offsets.rb:111:in `offsetsAndConfigurationIndex'
	from ./Source/JavaScriptCore/offlineasm/offsets.rb:109:in `open'
	from ./Source/JavaScriptCore/offlineasm/offsets.rb:109:in `offsetsAndConfigurationIndex'
	from ./Source/JavaScriptCore/offlineasm/asm.rb:208
make: *** [DerivedSources/JavaScriptCore/LLIntAssembly.h] Error 1

Based on official documentation, my understanding is that in ruby 1.8.x, "getc" gets a byte (1.8.6 documentation) while in ruby 1.9.x, "getc" gets a character while "getbyte" gets a byte (1.9.3 documentation).

The question mark is 1.8.7, whose documentation has a link in the sidebar for "getbyte" but which takes you to the definition of "getc", which appears twice. Snow Leopard, Lion and Mountain Lion ship with ruby 1.8.7 and the port builds there, so it seems (and the ruby 1.8.7 NEWS file confirms) that in ruby 1.8.7 "getbyte" is a compatibility alias for "getc".

Leopard has ruby 1.8.6 and Tiger has ruby 1.8.2. It seems the most correct thing to do, if you want to get a byte (which I assume is what the code in Source/JavaScriptCore/offlineasm/offsets.rb wants to do), is to check the ruby version, and use "getc" on ruby 1.8.x and earlier ande "getbyte" on ruby 1.9.x and later. I don't know enough ruby to be able to do that. For now, since all versions of OS X that MacPorts runs on today (10.4 through 10.8 inclusive) have ruby 1.8.x, we could get away with unconditionally changing "getbyte" to "getc".

I verified that changing "getbyte" to "getc" allows webkit-gtk @1.10.2 to build on Leopard.

Change History (1)

Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: patch-ruby-1.8.diff added
Note: See TracTickets for help on using tickets.