View Issue Details

IDProjectCategoryView StatusLast Update
0004182unrealircdpublic2013-04-05 15:37
ReporterDE_Glen Assigned Tosyzop  
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Platformx64OSLinuxOS Version3.2.0-39-generic
Product Version3.2.10 
Fixed in Version3.2.10.1 
Summary0004182: custom modules have difficulty linking additional shared libraries
DescriptionI made a module that needed to link to another shared lib. Eg:
make custommodule MODULEFILE=m_evolution EXLIBS=-lmongoc

Problem was linker order in Makefile put EXLIBS before the c file so the deps were not declared in time and the linker optimized away the lib ref; putting -lmongoc after the input C file in the Makefile fixes it.

Patch to fix follows:

diff -r 1672141ba571 -r 3a6ee5b44d73 src/modules/Makefile.in
--- a/src/modules/Makefile.in Mon Jan 14 02:12:43 2013 -0600
+++ b/src/modules/Makefile.in Wed Apr 03 10:38:50 2013 -0400
@@ -91,8 +91,8 @@
 build: $(MODULES)
 
 custommodule: $(MODULEFILE).c
- $(CC) $(CFLAGS) $(MODULEFLAGS) $(EXLIBS) -DDYNAMIC_LINKING \
- -o $(MODULEFILE).so $(MODULEFILE).c
+ $(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
+ -o $(MODULEFILE).so $(MODULEFILE).c $(EXLIBS)
 
 commands.so: l_commands.c $(COMMANDS) $(INCLUDES)
        $(CC) $(CFLAGS) $(MODULEFLAGS) -o commands.so l_commands.c \
TagsNo tags attached.
3rd party modules

Activities

syzop

2013-04-05 15:37

administrator   ~0017472

Thanks for the patch.

- Custom modules: move EXLIBS= so shared libraries are always linked.
  Reported by DE_Glen (0004182).

3.2: http://hg.unrealircd.com/hg/unreal/rev/25922088089b
3.4: http://hg.unrealircd.com/hg/unreal/rev/d30c92559ff1

Issue History

Date Modified Username Field Change
2013-04-03 16:50 DE_Glen New Issue
2013-04-05 15:37 syzop Note Added: 0017472
2013-04-05 15:37 syzop Status new => resolved
2013-04-05 15:37 syzop Fixed in Version => 3.2.10.1
2013-04-05 15:37 syzop Resolution open => fixed
2013-04-05 15:37 syzop Assigned To => syzop