#31742 closed defect (fixed)
librsync doesn't correctly export inlined functions when compiled with clang
Reported by: | mzch@… | Owned by: | lperry (Perry Lee) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.0.3 |
Keywords: | Cc: | miha.valencic@…, ranauei@… | |
Port: | librsync |
Description
rdiff-backup can successfully be built and installed, but doesn't work. Error messages as below:
Traceback (most recent call last): File "/opt/local/bin/rdiff-backup", line 20, in <module> import rdiff_backup.Main File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/Main.py", line 25, in <module> import Globals, Time, SetConnections, selection, robust, rpath, \ File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/SetConnections.py", line 30, in <module> import Globals, connection, rpath File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/connection.py", line 539, in <module> import Globals, Time, Rdiff, Hardlink, FilenameMapping, C, Security, \ File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/Rdiff.py", line 22, in <module> import os, librsync File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/librsync.py", line 28, in <module> import _librsync ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/_librsync.so, 2): Symbol not found: _rs_appendflush Referenced from: /opt/local/lib/librsync.1.dylib Expected in: flat namespace in /opt/local/lib/librsync.1.dylib
Change History (10)
comment:1 Changed 13 years ago by mf2k (Frank Schima)
Owner: | changed from macports-tickets@… to perry@… |
---|---|
Port: | rdiff-backup added |
comment:2 follow-up: 3 Changed 13 years ago by mzch@…
comment:3 Changed 13 years ago by thomas@…
Replying to mzch@…:
Hi,
Librsync 0.9.8 causes this issue. In delta.c all _rs_append* functions are defined as inline, so those symbols are lost in librsync.dynlib.
The following log is a symbol table of delta.o (include rs_append* functions). Somehow, rs_appendflush is listed.
duplicity also seems to be affected by this bug:
Traceback (most recent call last): File "/opt/local/bin/duplicity", line 41, in <module> from duplicity import collections File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/duplicity/collections.py", line 29, in <module> from duplicity import path File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/duplicity/path.py", line 36, in <module> from duplicity import librsync File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/duplicity/librsync.py", line 29, in <module> import _librsync ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/duplicity/_librsync.so, 2): Symbol not found: _rs_appendflush Referenced from: /opt/local/lib/librsync.1.dylib Expected in: flat namespace in /opt/local/lib/librsync.1.dylib
comment:5 Changed 13 years ago by miha.valencic@…
Is there a workaround? I'm having the same problem on OS X Lion, MacPorts 2.0.3. On Snow Leopard, MacPorts version 1.9.2 it works.
comment:6 follow-up: 7 Changed 13 years ago by miha.valencic@…
If someone else want's a workaround, I can confirm that modifying delta.c (removing inline function modifier) on OS X Lion solves the problem.
I issued sudo port -d -k install librsync and then modified delta.c by hand and issued sudo make install && sudo make clean and rdiff is working again.
comment:7 Changed 13 years ago by elliotj@…
Thank you! My backups work again!
Replying to miha.valencic@…:
If someone else want's a workaround, I can confirm that modifying delta.c (removing inline function modifier) on OS X Lion solves the problem. ...
comment:8 Changed 13 years ago by neverpanic (Clemens Lang)
Port: | librsync added; rdiff-backup removed |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Summary: | rdiff-backup doesn't work. → librsync doesn't correctly export inlined functions when compiled with clang |
The problem is related to whether you use gcc or clang:
GCC by default compiles GNU89, which is C89 with some GNU extensions. C89 doesn't have inline, but GNU89 adds it. C99, which is what clang compiles by default, however, _has_ a specification for the inline keyword. GNU89's interpretation of the inline keyword differs from the one specified in C99, which is why this problem occurs.
For more information, read http://clang.llvm.org/compatibility.html#inline.
A working solution is to drop the inline keyword whenever librsync is compiled with clang and let the compiler figure out, whether it should inline the function or not. This is what I have done in r88255.
comment:9 Changed 13 years ago by neverpanic (Clemens Lang)
Reported upstream at https://sourceforge.net/tracker/?func=detail&aid=3464437&group_id=56125&atid=479439.
Hi,
Librsync 0.9.8 causes this issue. In delta.c all _rs_append* functions are defined as inline, so those symbols are lost in librsync.dynlib.
The following log is a symbol table of delta.o (include rs_append* functions). Somehow, rs_appendflush is listed.
I don't understand why inline function is listed in the symbol table, but I applied the following dirty-hack and made sure to fix this issue.