pandora_with_ruby.m4 uses LDFLAGS where LIBS should be used

Bug #707058 reported by Clint Byrum
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gearman Interface
New
Undecided
Unassigned
Pandora Build
New
Undecided
Unassigned

Bug Description

LIBS informs the build system of linking requirements whereas LDFLAGS just adds flags during linking.

This breaks using PANDORA_WITH_RUBY on Ubuntu Natty because of the implicit --as-needed that has been enabled in the linker.

This is the config.log section on natty:

configure:19847: checking for ruby
configure:19863: found /usr/bin/ruby
configure:19874: result: ruby
configure:19891: checking for ruby devel
configure:19922: gcc -std=gnu99 -o conftest -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -lruby1.8 conftest.c >&5
In file included from /usr/lib/ruby/1.8/x86_64-linux/ruby.h:24:0,
                 from conftest.c:49:
/usr/lib/ruby/1.8/x86_64-linux/config.h:2:0: warning: "PACKAGE_NAME" redefined
conftest.c:2:0: note: this is the location of the previous definition
/usr/lib/ruby/1.8/x86_64-linux/config.h:3:0: warning: "PACKAGE_TARNAME" redefined
conftest.c:3:0: note: this is the location of the previous definition
/usr/lib/ruby/1.8/x86_64-linux/config.h:4:0: warning: "PACKAGE_VERSION" redefined
conftest.c:4:0: note: this is the location of the previous definition
/usr/lib/ruby/1.8/x86_64-linux/config.h:5:0: warning: "PACKAGE_STRING" redefined
conftest.c:5:0: note: this is the location of the previous definition
/usr/lib/ruby/1.8/x86_64-linux/config.h:6:0: warning: "PACKAGE_BUGREPORT" redefined
conftest.c:6:0: note: this is the location of the previous definition
/tmp/ccSvvtOl.o: In function `main':
conftest.c:(.text+0xe): undefined reference to `rb_define_module'
collect2: ld returned 1 exit status
configure:19922: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "gearman-interface"
| #define PACKAGE_TARNAME "gearman-interface"
| #define PACKAGE_VERSION "0.13.2"
| #define PACKAGE_STRING "gearman-interface 0.13.2"
| #define PACKAGE_BUGREPORT "https://launchpad.net/gearman-interface"
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_STDLIB_H 1
| #define HAVE_MALLOC 1
| #define HAVE_STDLIB_H 1
| #define HAVE_REALLOC 1
| #define PACKAGE "gearman-interface"
| #define VERSION "0.13.2"
| #define HOST_VENDOR "pc"
| #define HOST_OS "linux-gnu"
| #define HOST_CPU "x86_64"
| #define TARGET_VENDOR "pc"
| #define TARGET_OS "linux-gnu"
| #define TARGET_CPU "x86_64"
| #define TARGET_OS_LINUX 1
| #define STDCXX_98_HEADERS /**/
| #define HAVE_MEMORY 1
| #define HAVE_TR1_MEMORY 1
| #define SHARED_PTR_NAMESPACE std::tr1
| #define restrict __restrict
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_VISIBILITY 1
| #define HAVE_ASSERT_H 1
| #define HAVE_LIBGEARMAN 1
| #define SWIG_TYPE_TABLE gearman-interface
| /* end confdefs.h. */
| #include <ruby.h>
| int
| main ()
| {
| VALUE rb_ac_test = rb_define_module("actest");
| ;
| return 0;
| }
configure:19926: result: missing

After changing references in the file to LDFLAGS to LIBS, this is the resulting config.log:

configure:19889: checking for ruby
configure:19905: found /usr/bin/ruby
configure:19916: result: ruby
configure:19933: checking for ruby devel
configure:19964: gcc -std=gnu99 -o conftest -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux conftest.c -lruby1.8 >&5
In file included from /usr/lib/ruby/1.8/x86_64-linux/ruby.h:24:0,
                 from conftest.c:49:
/usr/lib/ruby/1.8/x86_64-linux/config.h:2:0: warning: "PACKAGE_NAME" redefined
conftest.c:2:0: note: this is the location of the previous definition
/usr/lib/ruby/1.8/x86_64-linux/config.h:3:0: warning: "PACKAGE_TARNAME" redefined
conftest.c:3:0: note: this is the location of the previous definition
/usr/lib/ruby/1.8/x86_64-linux/config.h:4:0: warning: "PACKAGE_VERSION" redefined
conftest.c:4:0: note: this is the location of the previous definition
/usr/lib/ruby/1.8/x86_64-linux/config.h:5:0: warning: "PACKAGE_STRING" redefined
conftest.c:5:0: note: this is the location of the previous definition
/usr/lib/ruby/1.8/x86_64-linux/config.h:6:0: warning: "PACKAGE_BUGREPORT" redefined
conftest.c:6:0: note: this is the location of the previous definition
configure:19964: $? = 0
configure:19965: result: found

Note that the order of -lruby1.8 and conftest.c were changed, resulting in successful linking.

I will submit a merge proposal with the patch...

Related branches

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.