Pass a function pointer

303 views
Skip to first unread message

Ary Manzana

unread,
Jul 25, 2011, 2:59:41 PM7/25/11
to ruby-llvm
Hi!

I need to do something like this (not sure it's the correct C syntax):

void foo() {
}

void bar(void (*func)()) { // 1
func(); // 2
}

void main() {
bar(&foo); //3
}

So basically I need to:

1. Define a function pointer type (I guess LLVM::Type.function ...
will do, but do I need to do
LLVM::Type.pointer(LLVM::Type.function ...) ? )
2. I need to invoke a function pointer. I currently have the function
object and I know it's the last parameter of the function, so I try to
do builder.call(fun.params[-1]) (though that last access to the last
element of params takes like 5 seconds, I don't know why... bug?)
3. I need to invoke a function passing it a reference to a function.

How can I do all of that? I tried many things but in all cases I got
stack overflows.... :-(

Thanks!
Ary

Jeremy Voorhis

unread,
Jul 25, 2011, 3:45:51 PM7/25/11
to ruby...@googlegroups.com
On Monday, July 25, 2011 at 11:59 AM, Ary Manzana wrote:
Hi!

I need to do something like this (not sure it's the correct C syntax):

void foo() {
}

void bar(void (*func)()) { // 1
func(); // 2
}

void main() {
bar(&foo); //3
}

So basically I need to:

1. Define a function pointer type (I guess LLVM::Type.function ...
will do, but do I need to do
LLVM::Type.pointer(LLVM::Type.function ...) ? )
A nicer way to write it is LLVM::Function([arg1, ... argn], ret). Yes, you will also need its pointer type, which can be gotten by passing the function type to LLVM::Pointer().
 
2. I need to invoke a function pointer. I currently have the function
object and I know it's the last parameter of the function, so I try to
do builder.call(fun.params[-1]) (though that last access to the last
element of params takes like 5 seconds, I don't know why... bug?)
3. I need to invoke a function passing it a reference to a function.

How can I do all of that? I tried many things but in all cases I got
stack overflows.... :-(
Make sure you declared your arguments as function pointers and not functions. Then just pass a reference to the LLVM::Function you wish to call. The call instruction will make indirect calls when given function pointers. I've created an example of this at https://gist.github.com/1104984.

HTH,

Jeremy Voorhis
Thanks!
Ary

Ary Manzana

unread,
Jul 26, 2011, 1:32:49 PM7/26/11
to ruby...@googlegroups.com
Thanks Jeremy, it works like a charm.

The problem I was having in my code is that I'm trying to access the last parameter of a function doing fun.params[-1] (I'm implementing a language that has blocks like ruby and they are always the last parameter). The problem is, it seems -1 is sent directly to the LLVM binding without honoring ruby's convention of negative indices for array access. Curious enough, that didn't segfault (it gave me some Value) but then everything crashes when I use it.

So the method of ParameterCollection should be changed to:

 # Returns a Value representation of the parameter at the given index.
 def [](i)
   i = size - i if i < 0
   Value.from_ptr(C.LLVMGetParam(@fun, i))
 end

What do you think?

Jeremy Voorhis

unread,
Jul 26, 2011, 10:17:10 PM7/26/11
to ruby...@googlegroups.com
Hi Ary,

On Tuesday, July 26, 2011 at 10:32 AM, Ary Manzana wrote:

Thanks Jeremy, it works like a charm.

The problem I was having in my code is that I'm trying to access the last parameter of a function doing fun.params[-1] (I'm implementing a language that has blocks like ruby and they are always the last parameter). The problem is, it seems -1 is sent directly to the LLVM binding without honoring ruby's convention of negative indices for array access. Curious enough, that didn't segfault (it gave me some Value) but then everything crashes when I use it.

So the method of ParameterCollection should be changed to:

 # Returns a Value representation of the parameter at the given index.
 def [](i)
   i = size - i if i < 0
   Value.from_ptr(C.LLVMGetParam(@fun, i))
 end

What do you think?

I hadn't anticipated your usage of params[], but it seems perfectly valid to me. I encourage you to fork the project, add that functionality with a unit test, and send me a pull request.

I would also try to cover the case where i < -size, that is, return nil when you try to index too far from the end of the collection.

Best,

Jeremy Voorhis

Ary Manzana

unread,
Jul 28, 2011, 2:58:17 PM7/28/11
to ruby...@googlegroups.com
Done :-)

Unit tests are good. It was an addition, not a subtraction I had to do.. :-P

Jeremy Voorhis

unread,
Aug 1, 2011, 1:50:33 PM8/1/11
to ruby...@googlegroups.com
Hi Ary,

I merged your changes into the next branch with a couple of minor updates. The tests now use Module.new instead of Module.create, and yes, size is only called once now :) I have also added your name to the list of contributors. You can see the latest at https://github.com/jvoorhis/ruby-llvm/commits/next.

Thanks for your contribution!

Jeremy

Ary Borenszweig

unread,
Aug 1, 2011, 2:20:41 PM8/1/11
to ruby...@googlegroups.com
Hi Jeremy!

Thanks for adding me to the list of contributors. Actually my last name is Borenszweig, Manzana is just a nickname (means "apple" in Spanish), I forgot to change it in my email settings... 

You can be sure I will contribute more to llvm-ruby since I'm actively using it. Well, I'm actually using chriswailes branch since I can link C functions... will you merge his changes in the future?

Jeremy Voorhis

unread,
Aug 1, 2011, 2:36:36 PM8/1/11
to ruby...@googlegroups.com, chris....@gmail.com
Hi Ary,

I've fixed your name in the README. I would like to merge Chris's branch, but I've had some difficulties. Firstly, I cannot run it because the extension is Linux-specific, and I use ruby-llvm in OS X-specific projects. I also have not fully warmed up to the idea of auto-generating the bindings, but I definitely want to merge the external function linking capability before the next release.

Chris,

I have been busy with work and travel, but I'm interested in sorting through these changes and putting together a new release that meets both of our needs. Interested?

Best,

Jeremy

Ary Borenszweig

unread,
Aug 1, 2011, 2:40:40 PM8/1/11
to ruby...@googlegroups.com, chris....@gmail.com
Hi Jeremy,

Well, I also have OS X and I was able to make it run. I had to change some things, though, so it would be nice to make it work for whatever system we use. So sure, let me know what you need so we can merge the external function linking capability to the next release.

Totally offtopic: where are you travelling? :-)

Jeremy Voorhis

unread,
Aug 1, 2011, 8:11:46 PM8/1/11
to ruby...@googlegroups.com, chris....@gmail.com
On Monday, August 1, 2011 at 11:40 AM, Ary Borenszweig wrote:
Hi Jeremy,

Well, I also have OS X and I was able to make it run. I had to change some things, though, so it would be nice to make it work for whatever system we use. So sure, let me know what you need so we can merge the external function linking capability to the next release.
If your changes are cross-platform, can you share them? I was tempted to just s/so/dylib/g and get started, but I'd like to distribute a cross-platform gem.
Totally offtopic: where are you travelling? :-)
I just got back from visiting family on the east coast. I'm looking forward to visiting Istanbul later this year.

Best,

Jeremy

Jeremy Voorhis

unread,
Aug 2, 2011, 5:29:57 PM8/2/11
to ruby...@googlegroups.com
Last night I started playing with different approaches to distributing a support library with ruby-llvm to provide functionality that llvm-c does not. The source is based upon Chris Wailes' branch, but can be grown to include additional functionality like intrinsics (the Python bindings include a similar support lib for this). For better or worse, my work-in-progress includes a cross-platform autotools build system.

It's not quite ready for sharing, but I hope to have this in my next branch by this weekend.

Best,

Jeremy

Ary Borenszweig

unread,
Aug 2, 2011, 9:44:42 PM8/2/11
to ruby...@googlegroups.com
Cool!

Sorry, I only have time on the weekend to give ruby-llvm (and my language :-P) some attention... To make Chris Wailes changes work I just replaced so with dylib, so that doesn't count as cross-platform, right? :-P

So... should I try to work on that or I should wait for your new different approach?

Best,
Ary

Jeremy Voorhis

unread,
Aug 3, 2011, 2:04:06 AM8/3/11
to ruby...@googlegroups.com
I've just pushed my work-in-progress to a new branch named support-lib. You can see the diff at https://github.com/jvoorhis/ruby-llvm/commit/af56052472aac560ef10f222aeb58b9def7074c5.

While the build is quite different from Chris' next branch, and not all of his enhancements have been ported yet, this commit does provide support for LLVM.load_library using the same api and allows us to add future enhancements not covered by the llvm-c bindings.

For those who would like to try out the new branch without mucking around with autotools, I've uploaded a gem to http://jvoorhis.com/ruby-llvm/ruby-llvm-2.9.2.gem. RubyGems should compile, link and install the library on installation.

Best,

Jeremy


On Tuesday, August 2, 2011 at 6:44 PM, Ary Borenszweig wrote:

> Cool!
>
> Sorry, I only have time on the weekend to give ruby-llvm (and my language :-P) some attention... To make Chris Wailes changes work I just replaced so with dylib, so that doesn't count as cross-platform, right? :-P
>
> So... should I try to work on that or I should wait for your new different approach?
>
> Best,
> Ary
>

> On Tue, Aug 2, 2011 at 6:29 PM, Jeremy Voorhis <jvoo...@gmail.com (mailto:jvoo...@gmail.com)> wrote:
> > Last night I started playing with different approaches to distributing a support library with ruby-llvm to provide functionality that llvm-c does not. The source is based upon Chris Wailes' branch, but can be grown to include additional functionality like intrinsics (the Python bindings include a similar support lib for this). For better or worse, my work-in-progress includes a cross-platform autotools build system.
> >
> > It's not quite ready for sharing, but I hope to have this in my next branch by this weekend.
> >
> > Best,
> >
> > Jeremy
> >
> > On Monday, August 1, 2011 at 5:11 PM, Jeremy Voorhis wrote:
> >
> > > On Monday, August 1, 2011 at 11:40 AM, Ary Borenszweig wrote:
> > > > Hi Jeremy,
> > > >
> > > > Well, I also have OS X and I was able to make it run. I had to change some things, though, so it would be nice to make it work for whatever system we use. So sure, let me know what you need so we can merge the external function linking capability to the next release.
> > > If your changes are cross-platform, can you share them? I was tempted to just s/so/dylib/g and get started, but I'd like to distribute a cross-platform gem.
> > > > Totally offtopic: where are you travelling? :-)
> > > I just got back from visiting family on the east coast. I'm looking forward to visiting Istanbul later this year.
> > >
> > > Best,
> > >
> > > Jeremy

> > > > On Mon, Aug 1, 2011 at 3:36 PM, Jeremy Voorhis <jvoo...@gmail.com (mailto:jvoo...@gmail.com)> wrote:
> > > > > Hi Ary,
> > > > >
> > > > > I've fixed your name in the README. I would like to merge Chris's branch, but I've had some difficulties. Firstly, I cannot run it because the extension is Linux-specific, and I use ruby-llvm in OS X-specific projects. I also have not fully warmed up to the idea of auto-generating the bindings, but I definitely want to merge the external function linking capability before the next release.
> > > > >
> > > > > Chris,
> > > > >
> > > > > I have been busy with work and travel, but I'm interested in sorting through these changes and putting together a new release that meets both of our needs. Interested?
> > > > >
> > > > > Best,
> > > > >
> > > > > Jeremy
> > > > >
> > > > > On Monday, August 1, 2011 at 11:20 AM, Ary Borenszweig wrote:
> > > > >
> > > > > > Hi Jeremy!
> > > > > >
> > > > > > Thanks for adding me to the list of contributors. Actually my last name is Borenszweig, Manzana is just a nickname (means "apple" in Spanish), I forgot to change it in my email settings...
> > > > > >
> > > > > > You can be sure I will contribute more to llvm-ruby since I'm actively using it. Well, I'm actually using chriswailes branch since I can link C functions... will you merge his changes in the future?

Ary Borenszweig

unread,
Aug 3, 2011, 8:39:09 AM8/3/11
to ruby...@googlegroups.com
Awesome! Tried it and it works for me on a Mac. I will try today later on Ubuntu...

By the way, any idea on how to track down why I get a segmentation fault from time to time with some code? It's very strange, about %5 of the time when running that code I get a segmentation fault (I don't have the code but I have the code that generates that code... I will try to translate it manually from my language).

Ary Borenszweig

unread,
Aug 3, 2011, 1:16:34 PM8/3/11
to ruby...@googlegroups.com
Nevermind, found the bug in my code :-)

Jeremy Voorhis

unread,
Aug 3, 2011, 1:21:12 PM8/3/11
to ruby...@googlegroups.com
On Wednesday, August 3, 2011 at 10:16 AM, Ary Borenszweig wrote:
Nevermind, found the bug in my code :-)
Even if your code survive's LLVM's validation pass, it's still possible that your code will do bad things with memory. I've been thinking on and off about how to make debugging easier, and I'm open to suggestions.
On Wed, Aug 3, 2011 at 9:39 AM, Ary Borenszweig <a...@esperanto.org.ar> wrote:
Awesome! Tried it and it works for me on a Mac. I will try today later on Ubuntu...
Thanks! This is a big help in putting together the release.

Ary Borenszweig

unread,
Aug 4, 2011, 8:54:30 AM8/4/11
to ruby...@googlegroups.com
Ok, tried on two different arch linuxes and couldn't install them. Here's the log:

---
[asterite@myhost crystal]$ gem install ~/Downloads/ruby-llvm-2.9.2.gem 
Building native extensions.  This could take a while...
ERROR:  Error installing /home/asterite/Downloads/ruby-llvm-2.9.2.gem:
ERROR: Failed to build gem native extension.

        sh ./configure --prefix=/home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/lib
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: executing depfiles commands
config.status: executing libtool commands

make
cd . && /bin/sh /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/missing --run aclocal-1.10 
/home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/missing: line 54: aclocal-1.10: command not found
WARNING: `aclocal-1.10' is missing on your system.  You should only need it if
         you modified `acinclude.m4' or `configure.ac'.  You might want
         to install the `Automake' and `Perl' packages.  Grab them from
         any GNU archive site.
 cd . && /bin/sh /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/missing --run automake-1.10 --foreign 
/home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/missing: line 54: automake-1.10: command not found
WARNING: `automake-1.10' is missing on your system.  You should only need it if
         you modified `Makefile.am', `acinclude.m4' or `configure.ac'.
         You might want to install the `Automake' and `Perl' packages.
         Grab them from any GNU archive site.
cd . && /bin/sh /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/missing --run autoconf
configure.ac:2: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
make: *** [configure] Error 1


Gem files will remain installed in /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2 for inspection.
Results logged to /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/gem_make.out
---

Maybe I need those libraries mentioned there, but I do have autoconf and perl... hmmm... (I didn't have time to investigate more, just run the command on two arch linux installation...)

Jeremy Voorhis

unread,
Aug 4, 2011, 11:31:21 AM8/4/11
to ruby...@googlegroups.com
Can you tell me which versions of automake you have, if any? I suspect I might have made a mistake :)

Thanks,

Jeremy

> you modified `acinclude.m4' or `configure.ac (http://configure.ac)'. You might want


> to install the `Automake' and `Perl' packages. Grab them from
> any GNU archive site.
> cd . && /bin/sh /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/missing --run automake-1.10 --foreign
> /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/missing: line 54: automake-1.10: command not found
> WARNING: `automake-1.10' is missing on your system. You should only need it if

> you modified `Makefile.am (http://Makefile.am)', `acinclude.m4' or `configure.ac (http://configure.ac)'.


> You might want to install the `Automake' and `Perl' packages.
> Grab them from any GNU archive site.
> cd . && /bin/sh /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/missing --run autoconf

> configure.ac:2 (http://configure.ac:2): error: possibly undefined macro: AM_INIT_AUTOMAKE


> If this token and others are legitimate, please use m4_pattern_allow.
> See the Autoconf documentation.
> make: *** [configure] Error 1
>
>
> Gem files will remain installed in /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2 for inspection.
> Results logged to /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/gem_make.out
> ---
>
> Maybe I need those libraries mentioned there, but I do have autoconf and perl... hmmm... (I didn't have time to investigate more, just run the command on two arch linux installation...)
>
>
> On Wed, Aug 3, 2011 at 2:21 PM, Jeremy Voorhis <jvoo...@gmail.com (mailto:jvoo...@gmail.com)> wrote:
> > On Wednesday, August 3, 2011 at 10:16 AM, Ary Borenszweig wrote:
> > > Nevermind, found the bug in my code :-)
> > Even if your code survive's LLVM's validation pass, it's still possible that your code will do bad things with memory. I've been thinking on and off about how to make debugging easier, and I'm open to suggestions.

> > > > > > > > > On Mon, Aug 1, 2011 at 3:36 PM, Jeremy Voorhis <jvoo...@gmail.com (mailto:jvoo...@gmail.com) (mailto:jvoo...@gmail.com)> wrote:
> > > > > > > > > > Hi Ary,
> > > > > > > > > >
> > > > > > > > > > I've fixed your name in the README. I would like to merge Chris's branch, but I've had some difficulties. Firstly, I cannot run it because the extension is Linux-specific, and I use ruby-llvm in OS X-specific projects. I also have not fully warmed up to the idea of auto-generating the bindings, but I definitely want to merge the external function linking capability before the next release.
> > > > > > > > > >
> > > > > > > > > > Chris,
> > > > > > > > > >
> > > > > > > > > > I have been busy with work and travel, but I'm interested in sorting through these changes and putting together a new release that meets both of our needs. Interested?
> > > > > > > > > >
> > > > > > > > > > Best,
> > > > > > > > > >
> > > > > > > > > > Jeremy
> > > > > > > > > >
> > > > > > > > > > On Monday, August 1, 2011 at 11:20 AM, Ary Borenszweig wrote:
> > > > > > > > > >
> > > > > > > > > > > Hi Jeremy!
> > > > > > > > > > >
> > > > > > > > > > > Thanks for adding me to the list of contributors. Actually my last name is Borenszweig, Manzana is just a nickname (means "apple" in Spanish), I forgot to change it in my email settings...
> > > > > > > > > > >
> > > > > > > > > > > You can be sure I will contribute more to llvm-ruby since I'm actively using it. Well, I'm actually using chriswailes branch since I can link C functions... will you merge his changes in the future?

Ary Borenszweig

unread,
Aug 6, 2011, 2:18:56 PM8/6/11
to ruby...@googlegroups.com
[asterite@myhost crystal]$ automake --version
automake (GNU automake) 1.11.1
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tro...@redhat.com>
       and Alexandre Duret-Lutz <a...@gnu.org>.

Jeremy Voorhis

unread,
Aug 7, 2011, 9:14:10 PM8/7/11
to ruby...@googlegroups.com
Hi Ary,

Thanks for your help. I've managed to reproduce the problem with Ubuntu 11.04 (I had trouble installing Arch with VirtualBox). Here's hoping I find a way to side-step the version dependency, or meet an autotools expert.

Best,

Jeremy


On Saturday, August 6, 2011 at 11:18 AM, Ary Borenszweig wrote:

> [asterite@myhost crystal]$ automake --version
> automake (GNU automake) 1.11.1
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>

> Written by Tom Tromey <tro...@redhat.com (mailto:tro...@redhat.com)>
> and Alexandre Duret-Lutz <a...@gnu.org (mailto:a...@gnu.org)>.

> > > you modified `acinclude.m4' or `configure.ac (http://configure.ac) (http://configure.ac)'. You might want


> > > to install the `Automake' and `Perl' packages. Grab them from
> > > any GNU archive site.
> > > cd . && /bin/sh /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/missing --run automake-1.10 --foreign
> > > /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/missing: line 54: automake-1.10: command not found
> > > WARNING: `automake-1.10' is missing on your system. You should only need it if

> > > you modified `Makefile.am (http://Makefile.am) (http://Makefile.am)', `acinclude.m4' or `configure.ac (http://configure.ac) (http://configure.ac)'.


> > > You might want to install the `Automake' and `Perl' packages.
> > > Grab them from any GNU archive site.
> > > cd . && /bin/sh /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/missing --run autoconf

> > > configure.ac:2 (http://configure.ac:2) (http://configure.ac:2): error: possibly undefined macro: AM_INIT_AUTOMAKE


> > > If this token and others are legitimate, please use m4_pattern_allow.
> > > See the Autoconf documentation.
> > > make: *** [configure] Error 1
> > >
> > >
> > > Gem files will remain installed in /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2 for inspection.
> > > Results logged to /home/asterite/.rvm/gems/ruby-1.9.2-p290@crystal/gems/ruby-llvm-2.9.2/ext/ruby-llvm-support/gem_make.out
> > > ---
> > >
> > > Maybe I need those libraries mentioned there, but I do have autoconf and perl... hmmm... (I didn't have time to investigate more, just run the command on two arch linux installation...)
> > >
> > >
> > > On Wed, Aug 3, 2011 at 2:21 PM, Jeremy Voorhis <jvoo...@gmail.com (mailto:jvoo...@gmail.com) (mailto:jvoo...@gmail.com)> wrote:
> > > > On Wednesday, August 3, 2011 at 10:16 AM, Ary Borenszweig wrote:
> > > > > Nevermind, found the bug in my code :-)
> > > > Even if your code survive's LLVM's validation pass, it's still possible that your code will do bad things with memory. I've been thinking on and off about how to make debugging easier, and I'm open to suggestions.

> > > > > > > > > > > On Mon, Aug 1, 2011 at 3:36 PM, Jeremy Voorhis <jvoo...@gmail.com (mailto:jvoo...@gmail.com) (mailto:jvoo...@gmail.com) (mailto:jvoo...@gmail.com)> wrote:
> > > > > > > > > > > > Hi Ary,
> > > > > > > > > > > >
> > > > > > > > > > > > I've fixed your name in the README. I would like to merge Chris's branch, but I've had some difficulties. Firstly, I cannot run it because the extension is Linux-specific, and I use ruby-llvm in OS X-specific projects. I also have not fully warmed up to the idea of auto-generating the bindings, but I definitely want to merge the external function linking capability before the next release.
> > > > > > > > > > > >
> > > > > > > > > > > > Chris,
> > > > > > > > > > > >
> > > > > > > > > > > > I have been busy with work and travel, but I'm interested in sorting through these changes and putting together a new release that meets both of our needs. Interested?
> > > > > > > > > > > >
> > > > > > > > > > > > Best,
> > > > > > > > > > > >
> > > > > > > > > > > > Jeremy
> > > > > > > > > > > >
> > > > > > > > > > > > On Monday, August 1, 2011 at 11:20 AM, Ary Borenszweig wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > > Hi Jeremy!
> > > > > > > > > > > > >
> > > > > > > > > > > > > Thanks for adding me to the list of contributors. Actually my last name is Borenszweig, Manzana is just a nickname (means "apple" in Spanish), I forgot to change it in my email settings...
> > > > > > > > > > > > >
> > > > > > > > > > > > > You can be sure I will contribute more to llvm-ruby since I'm actively using it. Well, I'm actually using chriswailes branch since I can link C functions... will you merge his changes in the future?

Reply all
Reply to author
Forward
0 new messages