Opened 9 years ago

Closed 9 years ago

#5759 closed Bug (fixed)

compilation error, revision 14327

Reported by: leandroong Owned by:
Priority: Normal Milestone: 2.90
Component: Transmission Version: 2.84
Severity: Normal Keywords:
Cc:

Description

Error like this .... utils-test.o: In function `test_truncd': /home/leandroong/mipsel-static/transmission/src/transmission/transmission-2.84+/libtransmission/utils-test.c:379: undefined reference to `sqrt' collect2: ld returned 1 exit status make[1]: * [utils-test] Error 1 ..

Attachments (2)

trac-5759-001-add-LT_LIB_M.rev_01.diff (2.3 KB) - added by jordan 9 years ago.
Use LT_LIB_M macro to pick up libm
config.log (14.3 KB) - added by leandroong 9 years ago.
config.log

Download all attachments as: .zip

Change History (17)

comment:1 Changed 9 years ago by leandroong

error code:

const double nan = sqrt (-1);

note: sqrt function parameters says "Value whose square root is computed. If the argument is negative, a domain error occurs."

comment:2 Changed 9 years ago by mike.dld

Most *NIX systems require linking to "m" library. We probably don't do that which results in linker error. Adding -lm to LDFLAGS should probably work for everyone.

Last edited 9 years ago by mike.dld (previous) (diff)

comment:3 Changed 9 years ago by leandroong

same error. Here is my configuration: LDFLAGS="-L$DEST/lib -Wl,--gc-sections -lm"

comment:4 Changed 9 years ago by leandroong

My last successful compilation is revision 14321. Only library update done is gettext and curl. I don't see why I can't compile suddenly.

comment:5 Changed 9 years ago by mike.dld

Particular error reported is caused by missing -lm. Could you double-check that the error is still there and it's still the same? What's your full ./configure ... line looks like?

comment:6 Changed 9 years ago by leandroong

1st compiled error, I use w/out -lm. Here is the configuration I use, written by lancetheparts, https://github.com/lancethepants/transmission-mipsel-static.

-- BASE=~/mipsel-static/transmission SRC=$BASE/src WGET="wget --prefer-family=IPv4" DEST=$BASE/opt LDFLAGS="-L$DEST/lib -Wl,--gc-sections" CPPFLAGS="-I$DEST/include" CFLAGS="-mtune=mips32 -mips32 -ffunction-sections -fdata-sections" CXXFLAGS=$CFLAGS CONFIGURE="./configure --prefix=/opt --host=mipsel-linux" MAKE="make -jnproc" ... ################ ############################################################ # TRANSMISSION # ############################################################ ################ ############################################################ .... LIBEVENT_CFLAGS="-I$DEST/include" \ LIBEVENT_LIBS=$DEST/lib/libevent.la \ LDFLAGS=$LDFLAGS \ CPPFLAGS=$CPPFLAGS \ CFLAGS=$CFLAGS \ CXXFLAGS=$CXXFLAGS \ $CONFIGURE \ --enable-lightweight \ --enable-daemon \ --enable-cli \ --without-gtk \ --enable-largefile

make LDFLAGS="-zmuldefs" LIBS="-all-static -ldl" make install DESTDIR=$BASE/transmission_ipkg-install

comment:7 Changed 9 years ago by leandroong

instead of applying -lm to LDFLAGS="-L$DEST/lib -Wl,--gc-sections" it should be applied on make LDFLAGS="-zmuldefs" LIBS="-all-static -ldl -lm"

Thanks to @lancetheparts and mike.dld expertise. I'm closing this issue.

comment:8 Changed 9 years ago by leandroong

  • Resolution set to fixed
  • Status changed from new to closed

comment:9 Changed 9 years ago by mike.dld

  • Resolution fixed deleted
  • Status changed from closed to reopened

I still think the issue is worth fixing in Transmission itself. Looks like using LT_LIB_M() in configuration script is the way to go.

comment:10 Changed 9 years ago by JJTagy

The use of sqrt has been in use for almost 5 years (r11345) in this file. I assume your math.h does not include sqrt?

Changed 9 years ago by jordan

Use LT_LIB_M macro to pick up libm

comment:11 Changed 9 years ago by jordan

leandroog, does trac-5759-001-add-LT_LIB_M.rev_01.diff​ fix the link error for you?

comment:12 Changed 9 years ago by leandroong

@jordan, applying patch "trac-5759-001-add-LT_LIB_M.rev_01.diff" result in successful compilation.

Last edited 9 years ago by leandroong (previous) (diff)

Changed 9 years ago by leandroong

config.log

comment:13 Changed 9 years ago by leandroong

Ignore above config.log.

comment:14 Changed 9 years ago by leandroong

Here is the successful compiled config.log https://www.dropbox.com/s/uvukxxk9d2rpuh9/config.log

Last edited 9 years ago by leandroong (previous) (diff)

comment:15 Changed 9 years ago by jordan

  • Milestone changed from None Set to 2.90
  • Resolution set to fixed
  • Status changed from reopened to closed
  • Version changed from 2.84+ to 2.84

Fixed r14328.

Note: See TracTickets for help on using tickets.