• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/linknx/0001-fix-static-build-with-mysql.patch
Baruch SiachBaruch Siach committed f35f54585f915 Mar 2016
Raw file
Source viewDiff to previous
 
1
Fix static build with mysql
2
​
3
When building static binaries, the order of libraries in the link command line
4
is significant. Use $LIBS for mysql libraries, so that mysql appear after the
5
object files that depends on it. This fixes build failures like the following.
6
​
7
/home/buildroot/build/instance-1/output/host/usr/bin/arm-linux-g++  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  -static -static -I/home/buildroot/build/instance-1/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/mysql  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  -static   -DUNIV_LINUX -DUNIV_LINUX  -static -static -rdynamic -L/home/buildroot/build/instance-1/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -o linknx linknx.o logger.o ruleserver.o objectcontroller.o eibclient.o threads.o timermanager.o persistentstorage.o xmlserver.o smsgateway.o emailgateway.o knxconnection.o services.o suncalc.o luacondition.o ioport.o ../ticpp/libticpp.a -L/home/buildroot/build/instance-1/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lpthsem    -lm -largp
8
persistentstorage.o: In function `MysqlPersistentStorage::~MysqlPersistentStorage()':
9
persistentstorage.cpp:(.text+0x2c): undefined reference to `mysql_close'
10
persistentstorage.o: In function `MysqlPersistentStorage::MysqlPersistentStorage(ticpp::Element*)':
11
persistentstorage.cpp:(.text+0x518): undefined reference to `mysql_init'
12
persistentstorage.cpp:(.text+0x570): undefined reference to `mysql_options'
13
persistentstorage.cpp:(.text+0x5a8): undefined reference to `mysql_real_connect'
14
persistentstorage.cpp:(.text+0x5c0): undefined reference to `mysql_options'
15
persistentstorage.cpp:(.text+0x618): undefined reference to `mysql_error'
16
persistentstorage.cpp:(.text+0x6c0): undefined reference to `mysql_options'
17
persistentstorage.o: In function `MysqlPersistentStorage::write(std::string const&, std::string const&)':
18
persistentstorage.cpp:(.text+0xb70): undefined reference to `mysql_real_query'
19
persistentstorage.cpp:(.text+0xbcc): undefined reference to `mysql_error'
20
persistentstorage.o: In function `MysqlPersistentStorage::read(std::string const&, std::string const&)':
21
persistentstorage.cpp:(.text+0xd14): undefined reference to `mysql_real_query'
22
persistentstorage.cpp:(.text+0xd38): undefined reference to `mysql_store_result'
23
persistentstorage.cpp:(.text+0xd40): undefined reference to `mysql_num_rows'
24
persistentstorage.cpp:(.text+0xd50): undefined reference to `mysql_fetch_row'
25
persistentstorage.cpp:(.text+0xd68): undefined reference to `mysql_free_result'
26
persistentstorage.cpp:(.text+0xdc8): undefined reference to `mysql_error'
27
persistentstorage.o: In function `MysqlPersistentStorage::writelog(std::string const&, std::string const&)':
28
persistentstorage.cpp:(.text+0xf74): undefined reference to `mysql_real_query'
29
persistentstorage.cpp:(.text+0xfd0): undefined reference to `mysql_error'
30
collect2: error: ld returned 1 exit status
31
​
32
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
33
---
34
Patch status: sent to jef2000@users.sourceforge.net
35
​
36
diff -Nuar linknx-0.0.1.32-orig/acinclude.m4 linknx-0.0.1.32/acinclude.m4
37
--- linknx-0.0.1.32-orig/acinclude.m4   2011-01-09 16:47:32.000000000 +0200
38
+++ linknx-0.0.1.32/acinclude.m4    2016-03-15 12:41:19.983861719 +0200
39
@@ -36,7 +36,7 @@
40
     CFLAGS="$CFLAGS $ADDFLAGS"    
41
     CXXFLAGS="$CXXFLAGS $ADDFLAGS"    
42
 
43
-    LDFLAGS="$LDFLAGS "`$MYSQL_CONFIG --libs_r`
44
+    LIBS="$LIBS "`$MYSQL_CONFIG --libs_r`
45
     
46
     AC_MSG_RESULT($MYSQL_CONFIG)
47
    AC_DEFINE([HAVE_MYSQL], [1], [Build with MySQL support.])
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.