Skip to contentSkip to conversation

nbd fails to compile with /usr/bin/klcc: unknown option: --sysroot=

Buildroot New Peter Hüwe 3 participants 5 messages Jun 23, 2010 – Jun 24, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

the atngw100_defconfig has nbd client and server enabled, and unfortunately it fails to compile, with the message

/usr/bin/klcc: unknown option: --sysroot=/avr/buildroot/output/staging/

$klcc --version
x86_64-pc-linux-gnu-gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.3)

How can I fix this ? - Unfortunately I'm not that into the whole buildroot system (yet, but I'd like to learn and contribute to it).

Thanks,
Peter

Here are the last few lines:

/usr/bin/klcc -DHAVE_CONFIG_H -I. -Os -pipe -Os -msoft-float -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -
I/avr/buildroot/output/staging/usr/include -I/avr/buildroot/output/staging/include --sysroot=/avr/buildroot/output/staging/ -isysroot /avr/buildroot/output/staging -c -o knbd_client-nbd-client.o nbd-client.c
/avr/buildroot/output/staging/usr/bin/avr32-unknown-linux-uclibc-gcc -Os -pipe -Os -msoft-float -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE - D_FILE_OFFSET_BITS=64 -I/avr/buildroot/output/staging/usr/include -I/avr/buildroot/output/staging/include --sysroot=/avr/buildroot/output/staging/ -isysroot
/avr/buildroot/output/staging -DHAVE_CONFIG_H -I. -Os -pipe -Os -msoft-float -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -
D_FILE_OFFSET_BITS=64 -I/avr/buildroot/output/staging/usr/include -I/avr/buildroot/output/staging/include --sysroot=/avr/buildroot/output/staging/ -isysroot /avr/buildroot/output/staging -MT nbd-client.o -MD -MP -MF .deps/nbd-client.Tpo -c -o nbd-client.o nbd-client.c
/usr/bin/klcc: unknown option: --sysroot=/avr/buildroot/output/staging/
make[2]: *** [knbd_client-nbd-client.o] Fehler 25
make[2]: *** Warte auf noch nicht beendete Prozesse...
In file included from nbd-client.c:17:
lfs.h:7:1: warning: "_LARGEFILE_SOURCE" redefined
<command-line>: warning: this is the location of the previous definition
In file included from nbd-server.c:56:
lfs.h:7:1: warning: "_LARGEFILE_SOURCE" redefined
<command-line>: warning: this is the location of the previous definition
mv -f .deps/nbd-client.Tpo .deps/nbd-client.Po
mv -f .deps/nbd_server-nbd-server.Tpo .deps/nbd_server-nbd-server.Po
make[2]: Leaving directory `/avr/buildroot/output/build/nbd-2.9.11'
make[1]: *** [all] Fehler 2
make[1]: Leaving directory `/avr/buildroot/output/build/nbd-2.9.11'
make: *** [/avr/buildroot/output/build/nbd-2.9.11/.stamp_built] Fehler 2

#1 lore raw
Quoted 8 lines · On Thu, 24 Jun 2010 00:53:12 +0200 Peter H?we <[email protected]> wrote:

the atngw100_defconfig has nbd client and server enabled, and unfortunately it fails to compile, with the message

/usr/bin/klcc: unknown option: --sysroot=/avr/buildroot/output/staging/

$klcc --version
x86_64-pc-linux-gnu-gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.3)

How can I fix this ? - Unfortunately I'm not that into the whole buildroot system (yet, but I'd like to learn and contribute to it).

It's because you have klcc installed on your development system, nbd detects it and uses it. Unfortunately, it doesn't understand all the usual gcc options.

You have two options to solve this problem:

*) Pass the --disable-klcc option to NBD's configure script. You could
add this to NBD_CONF_OPT.

*) Update to nbd 2.9.15 (the current version in Buildroot is 2.9.11),
which has removed support for klcc.

In any case, don't forget to send a patch ! :-)

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 nbd: Bump nbd to version 2.9.15 and remove klcc issue.

From: Peter Huewe <[email protected]>

This patch bumps the version of nbd to 2.9.15.
The new version avoids problems with klcc installed on the host system and also includes two former buildroot patches:
- nbd-fix-build-with-disable-lfs.patch
- nbd-server-fix-read-eagain.patch
These patches get removed from the buildroot tree by this patch too.

---
Patch against buildroot of git-20100624

 package/nbd/nbd-fix-build-with-disable-lfs.patch |   30 ----------------------
 package/nbd/nbd-server-fix-read-eagain.patch     |   21 ---------------
 package/nbd/nbd.mk                               |    2 +-
 3 files changed, 1 insertions(+), 52 deletions(-)
 delete mode 100644 package/nbd/nbd-fix-build-with-disable-lfs.patch
 delete mode 100644 package/nbd/nbd-server-fix-read-eagain.patch
package/nbd/nbd-fix-build-with-disable-lfs.patch deleted +0 -30
deleted file mode 100644
index 5b270aa..0000000
@@ -1,30 +0,0 @@
-From 6d452ab0247770a446cfa6dd9b8b4ddea6c8fa4b Mon Sep 17 00:00:00 2001
-From: Peter Korsgaard <[email protected]>
-Date: Sun, 22 Nov 2009 23:01:52 +0100
-Subject: [PATCH] lfs.h: fix build with --disable-lfs
-
-Running ./configure with --disable-lfs #define's NBD_LFS to 0 and
-doesn't #undef it, so the LFS check should use #if rather than #ifdef
-similar to how it is done in cliserv.h
-
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- lfs.h |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/lfs.h b/lfs.h
-index 8f90f81..929ce08 100644
---- a/lfs.h
-+++ b/lfs.h
-@@ -2,7 +2,7 @@
- #define LFS_H
- 
- #include "config.h"
--#ifdef NBD_LFS
-+#if NBD_LFS
- #define _FILE_OFFSET_BITS 64
- #define _LARGEFILE_SOURCE
- #endif /* NBD_LFS */
--- 
-1.6.3.3
-
package/nbd/nbd-server-fix-read-eagain.patch deleted +0 -21
deleted file mode 100644
index b1f966c..0000000
@@ -1,21 +0,0 @@
---- nbd-2.9.11.orig/nbd-server.c
-+++ nbd-2.9.11/nbd-server.c
-@@ -304,10 +304,14 @@
- 	ssize_t res;
- 	while (len > 0) {
- 		DEBUG("*");
--		if ((res = read(f, buf, len)) <= 0)
--			err("Read failed: %m");
--		len -= res;
--		buf += res;
-+		if ((res = read(f, buf, len)) <= 0) {
-+			if(errno != EAGAIN) {
-+				err("Read failed: %m");
-+			}
-+		} else {
-+			len -= res;
-+			buf += res;
-+		}
- 	}
- }
- 
package/nbd/nbd.mk +1 -1
index 8bffaf8..fa8dd4f 100644
@@ -4,7 +4,7 @@
 #
 #############################################################
 
-NBD_VERSION = 2.9.11
+NBD_VERSION = 2.9.15
 NBD_SOURCE = nbd-$(NBD_VERSION).tar.bz2
 NBD_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/nbd/
 NBD_CONF_OPT = $(if $(BR2_LARGEFILE),--enable-lfs,--disable-lfs)
Signature · 1 line
1.7.1
#3 lore raw

PATCH 1/1 nbd: Bump nbd to version 2.9.15 and remove klcc issue.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Huewe <[email protected]> writes:

Peter> From: Peter Huewe <[email protected]>

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw
In reply to Thomas Petazzoni

Am Donnerstag 24 Juni 2010 09:44:17 schrieb Thomas Petazzoni:

Quoted 4 lines

*) Update to nbd 2.9.15 (the current version in Buildroot is 2.9.11),
which has removed support for klcc.

In any case, don't forget to send a patch ! :-)

Created a patch and sent it to the mailing list - compiles fine. :) Thanks for the hint.

Peter