or Create a profile
19 Feb, 2013 06:04 PM
I need to target armel/armhf (soft float vs hard floats) on the
raspberry pi in one of my gems. My gem contains a binary which is
sensitive to hard vs. soft floats. ruby -e 'p
Gem::Platform.local.to_s' reports armv6l-linux on both hard
float and soft float OS. How can I make two gems, one for each of
the two platform differences? How can I figure out which platform
to target through the gem platform option?
ruby -e 'p
If there’s no way, do you have any ideas on how I might
approach the problem in another way? I currently fall back to
system binary if no platform-specific gem exists, but would really
like to have the ease-of-installation that the binary-supplying gem
Some more details:
I have a gem which includes a dynamic library. This library is
different per platform (e.g. linux vs mac vs windows), which I
currently target specifically. libspotify is the gem in question:
— for non-supported platforms I simply fall back to a
no-platform variant, which does not include the binary, and grabs
it from system-installed locations (if available).
Now, there is the raspberry pi (http://www.raspberrypi.org/),
which in essence is just a tiny computer. libspotify, the binary I
supply through my gem, has different binaries depending on if your
raspberry pi OS is using hard floats (armhf) or soft floats
(armel). However, I’m not sure if rubygems support targeting
these two separately, or how I can find it out. This last thing is
what I need help with.
2 Posted by Eric Hodel on 19 Feb, 2013 08:49 PM
Can you attach the rbconfig.rb for each platform?
3 Posted by Kim Burgestrand on 19 Feb, 2013 08:51 PM
Will do. How do I find it?
4 Posted by Eric Hodel on 19 Feb, 2013 08:54 PM
gem which rbconfig
5 Posted by Kim Burgestrand on 22 Feb, 2013 06:54 AM
Appears my comments (all five) are getting caught in a
moderation filter of sorts.
6 Posted by Eric Hodel on 26 Feb, 2013 12:49 AM
There is no difference between these two files so there is no
way for RubyGems to target one or the other.
Ultimately the values in rbconfig.rb come from autoconf. I'm
unsure of who to contact to figure out if autoconf knows there is a
If you have some other way of detecting the hardware you're
running on you can use extconf.rb to install the correct version
along with a platform targeted at arm-linux-gnueabi.
7 Posted by Kim Burgestrand on 27 Feb, 2013 09:14 PM
Looks like I have to fall back on some runtime check. Thanks
8 Posted by Eric Hodel on 27 Feb, 2013 09:18 PM
You can also package both versions of the shared library in your
gem and require the appropriate one at runtime. This technique is
known as "fat binary gems":
9 Posted by Eric Hodel on 27 Feb, 2013 09:18 PM
Eric Hodel closed this discussion
on 27 Feb, 2013 09:18 PM.
10 Posted by Eric Hodel on 27 Feb, 2013 09:18 PM
Comments are currently closed for this discussion.
You can start a new one.
2 people watching.
No more actions from RubyGems.org or the discussion starter are required.
This discussion is private.
Only you and RubyGems.org support staff can see and reply to it.
This discussion is public. Everyone can see and reply to it.
Powered by Tender™.