php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59780 Bug @ compil
Submitted: 2011-05-23 14:51 UTC Modified: 2011-09-01 07:57 UTC
From: j dot pardons at redline-hosting dot eu Assigned: koubel (profile)
Status: Closed Package: rrd (PECL)
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
 [2011-05-23 14:51 UTC] j dot pardons at redline-hosting dot eu
Description:
------------
cc -shared  .libs/rrd.o .libs/rrd_graph.o .libs/rrd_create.o .libs/rrd_update.o .libs/rrd_info.o  /usr/lib/librrd.so -L/usr/lib64  -Wl,-soname -Wl,rrd.so -o .libs/rrd.so
.libs/rrd_graph.o:(.data.rel.local+0x0): multiple definition of `arginfo_rrd_info'
.libs/rrd.o:(.data.rel.local+0x180): first defined here
.libs/rrd_graph.o:(.data.rel.local+0x60): multiple definition of `arginfo_rrd_graph'
.libs/rrd.o:(.data.rel.local+0x0): first defined here
.libs/rrd_create.o:(.data.rel.local+0x0): multiple definition of `arginfo_rrd_create'
.libs/rrd.o:(.data.rel.local+0x80): first defined here
.libs/rrd_update.o:(.data.rel.local+0x0): multiple definition of `arginfo_rrd_update'
.libs/rrd.o:(.data.rel.local+0x100): first defined here
.libs/rrd_update.o:(.data.rel.local+0x80): multiple definition of `arginfo_construct'
.libs/rrd_create.o:(.data.rel.local+0x80): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/../../../../x86_64-pc-linux-gnu/bin/ld: Warning: size of symbol `arginfo_construct' changed from 160 in .libs/rrd_create.o to 80 in .libs/rrd_update.o
.libs/rrd_info.o:(.data.rel.local+0x0): multiple definition of `arginfo_rrd_info'
.libs/rrd.o:(.data.rel.local+0x180): first defined here
collect2: ld returned 1 exit status
make: *** [rrd.la] Erreur 1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-31 20:37 UTC] ja391045 at gmail dot com
Try this patch.  It solved the compile error for me, but I'm not entirely sure all the features are right, since the php developers I work with haven't tested it out completely.

{noformat}
diff -Nuar rrd-1.0.4.orig/rrd_create.c rrd-1.0.4.new/rrd_create.c
--- rrd-1.0.4.orig/rrd_create.c 2011-08-12 07:50:10.000000000 -0700
+++ rrd-1.0.4.new/rrd_create.c  2011-08-31 17:20:02.000000000 -0700
@@ -22,7 +22,6 @@

 #include <rrd.h>
 #include "php.h"
-#include "rrd_create.h"
 #include "php_rrd.h"
 #include "zend_exceptions.h"
 #include "ext/standard/php_array.h"
@@ -335,7 +334,7 @@
 /* }}} */

 /* arguments */
-ZEND_BEGIN_ARG_INFO_EX(arginfo_construct, 0, 0, 1)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_construct_new, 0, 0, 1)
        ZEND_ARG_INFO(0, path)
        ZEND_ARG_INFO(0, startTime)
        ZEND_ARG_INFO(0, step)
@@ -347,7 +346,7 @@

 /* class method table */
 static zend_function_entry rrd_create_methods[] = {
-       PHP_ME(RRDCreator, __construct, arginfo_construct, ZEND_ACC_PUBLIC)
+       PHP_ME(RRDCreator, __construct, arginfo_construct_new, ZEND_ACC_PUBLIC)
        PHP_ME(RRDCreator, save, NULL, ZEND_ACC_PUBLIC)
        PHP_ME(RRDCreator, addDataSource, arginfo_description, ZEND_ACC_PUBLIC)
        PHP_ME(RRDCreator, addArchive, arginfo_description, ZEND_ACC_PUBLIC)
diff -Nuar rrd-1.0.4.orig/rrd_graph.c rrd-1.0.4.new/rrd_graph.c
--- rrd-1.0.4.orig/rrd_graph.c  2011-08-12 07:50:10.000000000 -0700
+++ rrd-1.0.4.new/rrd_graph.c   2011-08-31 17:20:19.000000000 -0700
@@ -27,8 +27,6 @@
 #include <rrd.h>

 #include "php_rrd.h"
-#include "rrd_info.h"
-#include "rrd_graph.h"

 /* declare class entry */
 static zend_class_entry *ce_rrd_graph;
diff -Nuar rrd-1.0.4.orig/rrd_info.c rrd-1.0.4.new/rrd_info.c
--- rrd-1.0.4.orig/rrd_info.c   2011-08-12 07:50:10.000000000 -0700
+++ rrd-1.0.4.new/rrd_info.c    2011-08-31 17:21:28.000000000 -0700
@@ -25,7 +25,8 @@
 #include <rrd.h>

 #include "php_rrd.h"
-#include "rrd_info.h"
+
+extern uint rrd_info_toarray(const rrd_info_t *rrd_info_data, zval *array TSRMLS_DC);

 /* {{{ proto array rrd_info(string file)
        Gets the header information from an RRD.
@@ -99,4 +100,4 @@

        return 1;
 }
-/* }}} */
\ No newline at end of file
+/* }}} */
diff -Nuar rrd-1.0.4.orig/rrd_update.c rrd-1.0.4.new/rrd_update.c
--- rrd-1.0.4.orig/rrd_update.c 2011-08-12 07:50:10.000000000 -0700
+++ rrd-1.0.4.new/rrd_update.c  2011-08-31 17:21:58.000000000 -0700
@@ -23,7 +23,6 @@
 #include <rrd.h>
 #include "php.h"
 #include "php_rrd.h"
-#include "rrd_update.h"
 #include "zend_exceptions.h"
 #include "ext/standard/php_smart_str.h"

{noformat}


If this fixes the compile time problem, but causes other errors, please let me know, as that would be valuable information for me.
 [2011-09-01 06:27 UTC] koubel at seznam dot cz
I moved ZEND_ARGINFO declarations from headers to rrd.c. I think it solves:
arginfo_rrd_info
arginfo_rrd_graph
arginfo_rrd_create
arginfo_rrd_update
problems.

I don't know why there is some problem with multiple definition of `arginfo_construct', because both `arginfo_construct' are declared in *.c via "ZEND_ARGINFO" macros, which are shortcuts for "static const arginfo_construct[]" declaration. I think it's correct to have same static const declaration in two modules.

Try to use current trunk and let me know if any warnings please.
 [2011-09-01 07:34 UTC] j dot pardons at redline-hosting dot eu
Hello,

It's works with the patch =)

Thanks a lot !
 [2011-09-01 07:41 UTC] koubel at seznam dot cz
patch from ja391045 at gmail dot com maybe solves compiling problems, but it's like quick fix. 

Solution with moving args_info declaration into rrd.c is more clear I think.

I also got answer in pecl mailing list about multiple definition of `arginfo_construct' problem. It's problem only for php < 5.3. I'll try to fix soon.
 [2011-09-01 07:57 UTC] koubel at seznam dot cz
I made final fix for multiple definition of
`arginfo_construct' problem, so bug is completely solved (in trunk), but I don't tested in 5.2. Reopen if necessary.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC