Opened 11 years ago

Closed 11 years ago

#3618 closed Bug (fixed)

FreeBSD 8.1 & GCC 4.2.1 compiler warnings

Reported by: mcz Owned by: charles
Priority: Normal Milestone: 2.12
Component: Transmission Version: 2.10
Severity: Minor Keywords:
Cc:

Description

Hi guys

I thought it would be nice to fix the compiler warnings in FreeBSD 8.1-RELEASE #0 with

# cc -v Using built-in specs. Target: amd64-undermydesk-freebsd Configured with: FreeBSD/amd64 system compiler Thread model: posix gcc version 4.2.1 20070719 [FreeBSD]

I appreciate your hard work on this fantastic piece of software :)

mcz

Attachments (7)

build-log.txt (14.3 KB) - added by mcz 11 years ago.
config.log (91.0 KB) - added by mcz 11 years ago.
mk.tar.gz (180.6 KB) - added by mcz 11 years ago.
additional makefiles used in fbsd 8.1 ports tree
transmission.tar.gz (4.7 KB) - added by mcz 11 years ago.
the patches applied to the transmission source to compile in fbsd
make2.out (3.3 KB) - added by mcz 11 years ago.
config2.out (8.5 KB) - added by mcz 11 years ago.
config2.log (94.7 KB) - added by mcz 11 years ago.

Download all attachments as: .zip

Change History (27)

Changed 11 years ago by mcz

comment:1 Changed 11 years ago by charles

  • Milestone changed from None Set to 2.11
  • Owner set to charles
  • Status changed from new to assigned
  • Version changed from 2.10+ to 2.10

some compiler errors fixed in r11301.

mcz: could you pull down a new tarball of r11301 or higher from https://build.transmissionbt.com/job/trunk-linux/ and attach a new build log?

comment:2 Changed 11 years ago by mcz

i was building it from the ports tree (net-p2p/transmission-daemon)

i pulled the source you mentioned, but it doesn't recognize the libevent library, even tough it's installed.

even if i define the libevents path:

$ LIBEVENT_LIBS=/usr/local/lib ./configure --enable-cli --enable-daemon

i get the following error:

...
checking xfs/xfs.h presence... no
checking for xfs/xfs.h... no
checking how to copy va_list... va_copy
checking for clock_gettime in -lrt... yes
test: xyes: unexpected operator
checking for evutil_vsnprintf in -levent... no
configure: error: libevent 1.4.9 or higher not found!

here are the libs:

$ ls -l libev*
lrwxr-xr-x  1 root  wheel      17 Oct  3 23:00 libevent-1.4.so -> libevent-1.4.so.4
-rwxr-xr-x  1 root  wheel  123248 Oct  3 23:00 libevent-1.4.so.4
-rw-r--r--  1 root  wheel  171360 Oct  3 23:00 libevent.a
-rwxr-xr-x  1 root  wheel     933 Oct  3 23:00 libevent.la
lrwxr-xr-x  1 root  wheel      17 Oct  3 23:00 libevent.so -> libevent-1.4.so.4
lrwxr-xr-x  1 root  wheel      22 Oct  3 23:00 libevent_core-1.4.so -> libevent_core-1.4.so.4
-rwxr-xr-x  1 root  wheel   49232 Oct  3 23:00 libevent_core-1.4.so.4
-rw-r--r--  1 root  wheel   62954 Oct  3 23:00 libevent_core.a
-rwxr-xr-x  1 root  wheel     968 Oct  3 23:00 libevent_core.la
lrwxr-xr-x  1 root  wheel      22 Oct  3 23:00 libevent_core.so -> libevent_core-1.4.so.4
lrwxr-xr-x  1 root  wheel      23 Oct  3 23:00 libevent_extra-1.4.so -> libevent_extra-1.4.so.4
-rwxr-xr-x  1 root  wheel   98991 Oct  3 23:00 libevent_extra-1.4.so.4
-rw-r--r--  1 root  wheel  132538 Oct  3 23:00 libevent_extra.a
-rwxr-xr-x  1 root  wheel     975 Oct  3 23:00 libevent_extra.la
lrwxr-xr-x  1 root  wheel      23 Oct  3 23:00 libevent_extra.so -> libevent_extra-1.4.so.4

comment:3 Changed 11 years ago by charles

Interesting! There appears to be a typo in configure.ac which is causing this. I've opened a separate ticket for that issue (Xref: #3620). Could you repeat the process with a tarball from >= r11302? :)

comment:4 Changed 11 years ago by mcz

the problem is still here:

$ svn co svn://svn.transmissionbt.com/Transmission/trunk Transmission

[ ... ]

A    Transmission/third-party/libevent/WIN32-Code/config.h
A    Transmission/third-party/libevent/install-sh
 U   Transmission/third-party/libevent
Checked out external at revision 1558.

Checked out revision 11303.

$ cd Transmission
$ ./autogen.sh 
creating libtransmission/version.h
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:22: installing `./config.guess'
configure.ac:22: installing `./config.sub'
configure.ac:21: installing `./install-sh'
configure.ac:21: installing `./missing'
cli/Makefile.am: installing `./depcomp'
Makefile.am: installing `./INSTALL'
Creating aclocal.m4 ...
Running glib-gettextize...  Ignore non-fatal messages.
Copying file mkinstalldirs
Copying file po/Makefile.in.in

Please add the files
  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4
  progtest.m4
from the /aclocal directory to your autoconf macro directory
or directly to your aclocal.m4 file.
You will also need config.guess and config.sub, which you can get from
ftp://ftp.gnu.org/pub/gnu/config/.

Making aclocal.m4 writable ...
Running intltoolize...
intltoolize: not found
Running ./configure --enable-maintainer-mode
configure: WARNING: unrecognized options: --enable-maintainer-mode
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking build system type... amd64-unknown-freebsd8.1
checking host system type... amd64-unknown-freebsd8.1
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... freebsd8.1 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... freebsd8.1 ld.so
checking how to hardcode library paths into programs... immediate
checking for inline... inline
checking gcc version... 4.2.1
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking for iconv_open... no
checking for pread... yes
checking for pwrite... yes
checking for lrintf... no
checking for strlcpy... yes
checking for daemon... yes
checking for dirname... yes
checking for basename... yes
checking for strcasecmp... yes
checking for localtime_r... yes
checking for fallocate64... no
checking for posix_fallocate... no
checking for memmem... yes
checking for strtold... yes
checking for syslog... yes
checking for valloc... yes
checking for getpagesize... yes
checking for posix_memalign... yes
checking whether make sets $(MAKE)... (cached) yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking for library containing cos... -lm
checking for library containing socket... none required
checking for library containing gethostbyname... none required
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for OPENSSL... gnome-config: not found
no
checking for OpenSSL... /usr
checking for LIBCURL... yes
checking for /tmp/dummy1_zlib.h... yes
checking for library containing gzopen... -lz
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for lseek64... no
checking whether posix_fadvise is declared... no
checking for posix_fadvise... no
checking sys/inotify.h usability... no
checking sys/inotify.h presence... no
checking for sys/inotify.h... no
checking sys/event.h usability... yes
checking sys/event.h presence... yes
checking for sys/event.h... yes
checking for kqueue... yes
checking xfs/xfs.h usability... no
checking xfs/xfs.h presence... no
checking for xfs/xfs.h... no
checking how to copy va_list... va_copy
checking for clock_gettime in -lrt... yes
checking for evutil_vsnprintf in -levent... no
configure: error: libevent 1.4.9 or higher not found!

Now type 'make' to compile Transmission.

comment:5 Changed 11 years ago by charles

No, this is something different. Notice the lack of the "test: xyes: unexpected operator" error message.

  • Can you attach the config.log file?
  • Are you sure that libevent 1.4.9 or higher is in your link path?

comment:6 Changed 11 years ago by mcz

libevent installed from ports:

$ pkg_info | grep event
libevent-1.4.14b_1  Provides an API to execute callback functions on certain ev

libevent files:

$ cd /usr/local/lib
$ ls -la *event*
lrwxr-xr-x  1 root  wheel      17 Oct  3 23:00 libevent-1.4.so -> libevent-1.4.so.4
-rwxr-xr-x  1 root  wheel  123248 Oct  3 23:00 libevent-1.4.so.4
-rw-r--r--  1 root  wheel  171360 Oct  3 23:00 libevent.a
-rwxr-xr-x  1 root  wheel     933 Oct  3 23:00 libevent.la
lrwxr-xr-x  1 root  wheel      17 Oct  3 23:00 libevent.so -> libevent-1.4.so.4
lrwxr-xr-x  1 root  wheel      22 Oct  3 23:00 libevent_core-1.4.so -> libevent_core-1.4.so.4
-rwxr-xr-x  1 root  wheel   49232 Oct  3 23:00 libevent_core-1.4.so.4
-rw-r--r--  1 root  wheel   62954 Oct  3 23:00 libevent_core.a
-rwxr-xr-x  1 root  wheel     968 Oct  3 23:00 libevent_core.la
lrwxr-xr-x  1 root  wheel      22 Oct  3 23:00 libevent_core.so -> libevent_core-1.4.so.4
lrwxr-xr-x  1 root  wheel      23 Oct  3 23:00 libevent_extra-1.4.so -> libevent_extra-1.4.so.4
-rwxr-xr-x  1 root  wheel   98991 Oct  3 23:00 libevent_extra-1.4.so.4
-rw-r--r--  1 root  wheel  132538 Oct  3 23:00 libevent_extra.a
-rwxr-xr-x  1 root  wheel     975 Oct  3 23:00 libevent_extra.la
lrwxr-xr-x  1 root  wheel      23 Oct  3 23:00 libevent_extra.so -> libevent_extra-1.4.so.4

dev files:

$ cd /usr/local/include/
$ find . -name "*event*"
./event.h
./event-config.h

and i attached the config.log

Changed 11 years ago by mcz

comment:7 Changed 11 years ago by mcz

btw .. other programs recognize the libevent port.

comment:8 Changed 11 years ago by charles

Ports is installing in /usr/local, but you haven't added it in your lib & include paths.

If other programs reference /usr/local without being told to, IMO that is a bug in the other programs.

You need to either modify your global lib & include paths, or to set LIBEVENT_CFLAGS and LIBEVENT_LIBS as you did in comment:2.

comment:9 Changed 11 years ago by mcz

somehow the folks made transmission work out of the ports tree net-p2p/transmission. somehow other programs know where to look for when they want to use a library in freebsd.

I attached the makefiles and the patches they used to build the sources. probably the answer is there.

transmission.tar.gz: the port tree make files, check out the patches applied to the transmission source in order to compile

mk.tar.gz: additional makefiles used by the ports

Changed 11 years ago by mcz

additional makefiles used in fbsd 8.1 ports tree

Changed 11 years ago by mcz

the patches applied to the transmission source to compile in fbsd

comment:11 Changed 11 years ago by charles

mcz: As I've already said, the issue reason you made progress before is, as you outlined in comment:2, that you told Transmission where to find libevent. You're no longer doing so, which is why your config.log attached between comment:6 and comment:7 contains the error "/usr/bin/ld: cannot find -levent"

LOCALBASE appears to be a valid BSDism, but surely you're not expecting me to implement it upstream? I generate Transmission's configure and Makefile.am files from the standard autoconf/automake/libtool toolchain. It's not clear to me that it's even possible to add LOCALBASE into the mix. Even if it were, it's also not clear to me what ripple effects that would have on the rest of Transmission's non-BSD userbase.

Anyway this is all unrelated to the original issue of the warnings being generated by BSD+GCC at compile time. If you get to the point where you can log a fresh set of compile-time warnings, please attach those to this ticket. Thank you!

comment:12 Changed 11 years ago by charles

mcz, any news?

comment:13 Changed 11 years ago by mcz

hey charles, as soon as the freebsd ports gets updated, i compile the source code again and let you know about the warnings. also i'm trying to setup a jail environment for you, so you can login with a shell account a test everything yourself freely as a root in fbsd 8.1. do you have gmail so we can im?

comment:14 Changed 11 years ago by charles

nope. if you want realtime back-and-forth, I can be found in freenode's #transmission channel though

comment:15 Changed 11 years ago by charles

  • Milestone changed from 2.11 to Sometime

I think this issue is resolved, but I'm going to leave it open for awhile to head back from mcz. Since I can't close this issue before 2.11, bumping the milestone from "2.11" to "Sometime."

comment:16 Changed 11 years ago by charles

  • Severity changed from Normal to Minor

comment:17 Changed 11 years ago by mcz

hey, i was able to compile the 2.11 T by myself :) some of the warnings are gone but some still exists. i was able to run configure with this command:

$ LIBEVENT_LIBS=/usr/local/lib/libevent.a ./configure --disable-nls --enable-cli --enable-daemon

i attached the configure output, log and the make output for you. from now on, i can compile probably any version without using freebsd ports so if you apply any changes, i can provide you feedback quickly.

Changed 11 years ago by mcz

Changed 11 years ago by mcz

Changed 11 years ago by mcz

comment:18 Changed 11 years ago by charles

Thanks mcz! I haven't had a chance to dig into this yet but I will do so.

comment:19 Changed 11 years ago by mcz

np charles, i appreciate your hard work on this software. let me know if you need anything else from an freebsd standpoint.

comment:20 Changed 11 years ago by charles

  • Milestone changed from Sometime to 2.12
  • Resolution set to fixed
  • Status changed from assigned to closed

I'm not sure what can be done with these remaining warnings. None of them are real problems but they also don't seem to be easy to silence.

Rather than leaving this ticket hanging indefinitely, I think I'm going to declare victory with the warnings already solved, and close this ticket as fixed. :)

mcz: thanks very much for all your help with this ticket. Please let me know if you find any future problems. Thanks!

Note: See TracTickets for help on using tickets.