public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alon Bar-Lev <alon.barlev@gmail.com>
To: Luciano Rocha <luciano@eurotux.com>
Cc: ldm@flatcap.org, ntfs-3g-devel@lists.sourceforge.net,
	LKML <linux-kernel@vger.kernel.org>,
	linux-ntfs-dev@lists.sourceforge.net
Subject: Re: ldminfo compilation
Date: Thu, 13 Dec 2007 00:59:09 +0200	[thread overview]
Message-ID: <200712130059.12026.alon.barlev@gmail.com> (raw)
In-Reply-To: <20071212164059.GA30348@bit.office.eurotux.com>

On Wednesday 12 December 2007, Luciano Rocha wrote:
> Anyway, how to compile with the sources of:

Thank you so much!!!!
I didn't think of using 2.4 headers... bad me!

Anyway, I can now hack this to compile with uclibc...
I don't know if it works yet, but at least it builds now (26KB)

I had to use newer kernel, as I had some gcc related errors in include/asm/processor.h
and CONFIG_SMP related conflicts.

I truly hope maintainer will find some time to make it regular 2.6.X user mode
application... There are many packages that use kernel headers, but are much
easier to build, without sharing one object between kernel and userspace.

Best Regards,
Alon Bar-Lev

So just for the record...

I am using the following script to build:

ldm=linux-ldm-0.0.8
kernel=linux-2.4.35.4
wget --continue http://downloads.sourceforge.net/linux-ntfs/$ldm.tar.bz2
wget --continue http://www.kernel.org/pub/linux/kernel/v2.4/$kernel.tar.bz2
tar xjf $ldm.tar.bz2
cd $ldm
patch -p1 < ../$ldm-build.diff
tar xjf ../$kernel.tar.bz2
yes n | make -C $kernel ARCH=i386 oldconfig dep
make clean
make KERNEL=$(pwd)/$kernel LDMINFO_LDFLAGS=-static
#make KERNEL=$(pwd)/$kernel LDMINFO_CC=i586-pc-linux-uclibc-gcc

And the following patch:

---

diff -urNp linux-ldm-0.0.8.org/Makefile linux-ldm-0.0.8/Makefile
--- linux-ldm-0.0.8.org/Makefile	2002-03-09 03:58:42.000000000 +0200
+++ linux-ldm-0.0.8/Makefile	2007-12-13 00:38:09.000000000 +0200
@@ -27,7 +27,14 @@ CFLAGS += -fomit-frame-pointer
 CFLAGS += -fno-strict-aliasing
 CFLAGS += -pipe
 CFLAGS += -mpreferred-stack-boundary=2
-CFLAGS += -march=$(shell uname -m)
+
+# libc fixups
+
+CFLAGS += -D__off_t_defined
+CFLAGS += -D__sigset_t_defined
+CFLAGS += -D_TIME_H
+CFLAGS += -D__defined_schedparam
+CFLAGS += -D__sched_param=sched_param
 
 # ld flags
 
diff -urNp linux-ldm-0.0.8.org/test/compat.c linux-ldm-0.0.8/test/compat.c
--- linux-ldm-0.0.8.org/test/compat.c	2002-08-05 18:46:51.000000000 +0300
+++ linux-ldm-0.0.8/test/compat.c	2007-12-13 00:38:09.000000000 +0200
@@ -171,7 +171,7 @@ unsigned char *read_dev_sector (struct b
 	return bh->b_data;
 }
 
-void __free_pages(struct page *page, unsigned int order)
+FASTCALL() void __free_pages(struct page *page, unsigned int order)
 {
 	atomic_dec (&page->count);
 	if (atomic_read (&page->count) < 1) {
diff -urNp linux-ldm-0.0.8.org/test/Makefile linux-ldm-0.0.8/test/Makefile
--- linux-ldm-0.0.8.org/test/Makefile	2002-02-23 18:38:51.000000000 +0200
+++ linux-ldm-0.0.8/test/Makefile	2007-12-13 00:39:58.000000000 +0200
@@ -8,6 +8,8 @@ INFODEP	= $(LDMDEP) compat.o copy.o dump
 
 OUT	= ldminfo sparse
 
+LDMINFO_CC = $(CC)
+
 CFLAGS += -include extra.h
 CFLAGS += -I$(KERNEL)/include
 CFLAGS += -I$(KERNEL)/fs/partitions
@@ -15,13 +17,13 @@ CFLAGS += -I$(KERNEL)/fs/partitions
 all:	$(OUT)
 
 .c.o:
-	$(CC) $(CFLAGS) -c $< -o $@
+	$(LDMINFO_CC) $(CFLAGS) -c $< -o $@
 
 ldminfo: $(INFODEP)
-	$(CC) -o ldminfo $(INFODEP)
+	$(LDMINFO_CC) $(LDMINFO_LDFLAGS) -o ldminfo $(INFODEP)
 
 sparse:
-	$(CC) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 sparse.c -o $@
+	$(LDMINFO_CC) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 sparse.c -o $@
 
 clean:
 	$(RM) $(OUT) $(OBJ)

      reply	other threads:[~2007-12-12 22:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-12 14:39 ldminfo compilation Alon Bar-Lev
2007-12-12 14:52 ` Luciano Rocha
2007-12-12 14:57   ` Alon Bar-Lev
2007-12-12 15:29     ` Luciano Rocha
2007-12-12 16:40       ` Luciano Rocha
2007-12-12 22:59         ` Alon Bar-Lev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200712130059.12026.alon.barlev@gmail.com \
    --to=alon.barlev@gmail.com \
    --cc=ldm@flatcap.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=luciano@eurotux.com \
    --cc=ntfs-3g-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox