Skip to contentSkip to conversation

UML - Include the linker script rather than symlink it

PATCH In review Jeff Dike 3 participants 9 messages May 1, 2005 – May 3, 2005 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 1/22 UML - Include the linker script rather than symlink it

Quoted 1 line

From Al Viro:

Make vmlinux.lds.S include appopriate script instead of playing
games with symlinks.

arch/um/Makefile +1 -14
Index: linux-2.6.11-mm/arch/um/Makefile
===================================================================
@@ -96,15 +96,11 @@
 
 $(shell cd $(ARCH_DIR) && ln -sf Kconfig_$(SUBARCH) Kconfig_arch)
 
-prepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) \
-	$(ARCH_DIR)/kernel/vmlinux.lds.S
+prepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS)
 
 LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
 LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
 
-LD_SCRIPT-$(CONFIG_LD_SCRIPT_STATIC) := uml.lds.S
-LD_SCRIPT-$(CONFIG_LD_SCRIPT_DYN) := dyn.lds.S
-
 CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT
 CONFIG_KERNEL_STACK_ORDER ?= 2
 STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] )
@@ -145,15 +141,6 @@
 	@find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
 		-o -name '*.gcov' \) -type f -print | xargs rm -f
 
-#We need to re-preprocess this when the symlink dest changes.
-#So we touch it when needed.
-$(ARCH_DIR)/kernel/vmlinux.lds.S: FORCE
-	$(Q)if [ "$(shell readlink $@)" != "$(LD_SCRIPT-y)" ]; then \
-		echo '  SYMLINK $@'; \
-		ln -sf $(LD_SCRIPT-y) $@; \
-		touch $@; \
-	fi;
-
 $(SYMLINK_HEADERS):
 	@echo '  SYMLINK $@'
 	$(Q)cd $(TOPDIR)/$(dir $@) ; \
arch/um/kernel/Makefile +0 -1
Index: linux-2.6.11-mm/arch/um/kernel/Makefile
===================================================================
@@ -4,7 +4,6 @@
 #
 
 extra-y := vmlinux.lds
-clean-files := vmlinux.lds.S
 
 obj-y = checksum.o config.o exec_kern.o exitcode.o \
 	helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o mem_user.o \
arch/um/kernel/vmlinux.lds.S +5 -112

118 lines not on this page · raw message

#1 lore raw
Quoted 8 lines · Jeff Dike
Quoted 2 lines

From Al Viro:

Make vmlinux.lds.S include appopriate script instead of playing
games with symlinks.

Confused.

arch/um/kernel/vmlinux.lds.S

Quoted 5 lines

Index: linux-2.6.11-mm/arch/um/kernel/vmlinux.lds.S
===================================================================

arch/um/kernel/vmlinux.lds.S +0 -0
@@ -1,113 +1,6 @@

That file doesn't exist and I think this patch doesn't want to patch it anyway.

I'll just drop the vmlinux.lds.S chunk...

#2 lore raw
Quoted 4 lines · Andrew Morton

That file doesn't exist and I think this patch doesn't want to patch it anyway.

I'll just drop the vmlinux.lds.S chunk...

Correct patch is on ftp.linux.org.uk/pub/people/viro/UM0-uml-ldscript-RC12-rc3

Short version of the story: current tree plays with a symlink from vmlinux.lds.S to one of two files, depending on the config. That doesn't work well and confused vmlinux.lds.S chunk is actually a demonstration of breakage - symlink had not been properly cleaned up.

New variant has _fixed_ vmlinux.lds.S - real file with #include <linux/config.h>
#ifdef CONFIG_LD_SCRIPT_STATIC
#include "uml.lds.S"
#else
#include "dyn.lds.S"
#endif
in it and no symlink magic in makefiles. Since we feed it through cpp anyway, we can simply let cpp do all work - including picking the right script depending on config.

#3 lore raw
Quoted 8 lines · Al Viro
Quoted 4 lines · Andrew Morton

That file doesn't exist and I think this patch doesn't want to patch it anyway.

I'll just drop the vmlinux.lds.S chunk...

Correct patch is on ftp.linux.org.uk/pub/people/viro/UM0-uml-ldscript-RC12-rc3

OK...

There's a bit of a tangle going on in arch/um/kernel/Makefile, but it's fairly simple stuff.

I put a rolled-up patch against 2.6.12-rc3 at
http://www.zip.com.au/~akpm/linux/patches/stuff/x.bz2 if someone wants to check it all.

Is this all considered post-2.6.12 material?

#4 lore raw
Quoted 7 lines · Andrew Morton

There's a bit of a tangle going on in arch/um/kernel/Makefile, but it's fairly simple stuff.

I put a rolled-up patch against 2.6.12-rc3 at
http://www.zip.com.au/~akpm/linux/patches/stuff/x.bz2 if someone wants to check it all.

Broken, due to missing mk_sc patch (it should go before mk_thread one; how the hell did the latter manage to apply at all?)

Quoted 1 line

Is this all considered post-2.6.12 material?

Once all patches are in there - up to Jeff ;-) Seriously, kbuild patchkit is decently tested and has obviously no impact on other architectures. So that one is up to maintainer of architecture in question...

#5 lore raw
Quoted 11 lines · Al Viro
Quoted 7 lines · Andrew Morton

There's a bit of a tangle going on in arch/um/kernel/Makefile, but it's fairly simple stuff.

I put a rolled-up patch against 2.6.12-rc3 at
http://www.zip.com.au/~akpm/linux/patches/stuff/x.bz2 if someone wants to check it all.

Broken, due to missing mk_sc patch (it should go before mk_thread one;

OK. I ended up with an odd-looking arch/um/sys-x86_64/util/Makefile:

# Copyright 2003 - 2004 Pathscale, Inc
# Released under the GPL

hostprogs-y := mk_sc mk_thread
always := $(hostprogs-y)

HOSTCFLAGS_mk_thread.o := -I$(objtree)/arch/um

Is mk_sc still supposed to be in there?

Quoted 1 line

how the hell did the latter manage to apply at all?)

I just "fixed" things. I do it all the time.

Quoted 5 lines
Quoted 1 line

Is this all considered post-2.6.12 material?

Once all patches are in there - up to Jeff ;-) Seriously, kbuild patchkit is decently tested and has obviously no impact on other architectures. So that one is up to maintainer of architecture in question...

OK..

#6 lore raw
Quoted 9 lines · Andrew Morton

# Copyright 2003 - 2004 Pathscale, Inc
# Released under the GPL

hostprogs-y := mk_sc mk_thread
always := $(hostprogs-y)

HOSTCFLAGS_mk_thread.o := -I$(objtree)/arch/um

Is mk_sc still supposed to be in there?

Yes, along with hostflags for it.

Quoted 3 lines
Quoted 1 line

how the hell did the latter manage to apply at all?)

I just "fixed" things. I do it all the time.

Erm... "Gives rejects" => "ought to investigate" => "bugger it, let submitter figure it out and resubmit" would be an obvious progression...

OK. Please, pick the following patches:
UM0-uml-ldscript-RC12-rc3
UM1-uml-os-RC12-rc3
UM2-uml-user-constants-RC12-rc3
UM3-uml-ptregs-RC12-rc3
UM4-uml-sc-RC12-rc3
UM5-uml-kernel-offsets-RC12-rc3
UM6-uml-thread-RC12-rc3
UM7-uml-util-RC12-rc3
UM8-uml-clean-RC12-rc3
UM10-uml-O-RC12-rc3
in ftp.linux.org.uk/pub/people/viro. In the order above. That's where the beginning of Jeff's series had come from (his 1--9 and 4.5).

(In case if you wonder about UM9, that one already has an equivalent in -mm).

#7 lore raw
Quoted 5 lines · Al Viro
Quoted 3 lines · Andrew Morton

# Copyright 2003 - 2004 Pathscale, Inc
# Released under the GPL

Quoted 8 lines
Quoted 6 lines

hostprogs-y := mk_sc mk_thread
always := $(hostprogs-y)

HOSTCFLAGS_mk_thread.o := -I$(objtree)/arch/um

Is mk_sc still supposed to be in there?

Yes, along with hostflags for it.

Ah, OK.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

how the hell did the latter manage to apply at all?)

I just "fixed" things. I do it all the time.

Erm... "Gives rejects" => "ought to investigate" => "bugger it, let submitter figure it out and resubmit" would be an obvious progression...

Sometimes. Most of the time it's less work (and much less latency) just to fix stuff up.

Quoted 5 lines

OK. Please, pick the following patches:
UM0-uml-ldscript-RC12-rc3
UM1-uml-os-RC12-rc3
UM2-uml-user-constants-RC12-rc3
UM3-uml-ptregs-RC12-rc3

Quoted 8 lines

UM4-uml-sc-RC12-rc3
UM5-uml-kernel-offsets-RC12-rc3
UM6-uml-thread-RC12-rc3
UM7-uml-util-RC12-rc3
UM8-uml-clean-RC12-rc3
UM10-uml-O-RC12-rc3
in ftp.linux.org.uk/pub/people/viro. In the order above. That's where the beginning of Jeff's series had come from (his 1--9 and 4.5).

OK, did that. Had one reject against uml-kbuild-avoid-useless-rebuilds.patch, but 'twas easily fixed.

author
#8 lore raw
Quoted 2 lines · Andrew Morton

OK, did that. Had one reject against uml-kbuild-avoid-useless-rebuilds.patch, but 'twas easily fixed.

Thanks. Sorry about the hassle. The vmlinux.lds botch was a symptom of the problem Al was fixing (the uncleaned symlink in my tree causing a reject in a clean tree), and the missing mk_sc patch was just an oversight on my part.

Jeff