Re: case-sensitive file names during build

From: Pragnesh Sampat
Date: Thu Jul 22 2004 - 18:29:42 EST


OK, here they are. I applied them against 2.6.6 and can regen them if
needed against current -mm. Also note that If you are using 2.6
versions earlier than 2.6.4, you will probably need 2-3 patches more.
(These were generated by various people here at TimeSys and modified for
different versions.)

1. Case insensitivity patch (rename files)

(I can supply a patch to rename all, if needed)

arch/alpha/kernel/vmlinux.lds.S
arch/arm/kernel/vmlinux.lds.S
arch/arm26/kernel/vmlinux.lds.S
arch/cris/arch-v10/vmlinux.lds.S
arch/h8300/kernel/vmlinux.lds.S
arch/i386/kernel/vmlinux.lds.S
arch/ia64/kernel/vmlinux.lds.S
arch/m68k/kernel/vmlinux.lds.S
arch/m68knommu/kernel/vmlinux.lds.S
arch/mips/kernel/vmlinux.lds.S
arch/parisc/kernel/vmlinux.lds.S
arch/ppc/kernel/vmlinux.lds.S
arch/ppc64/kernel/vmlinux.lds.S
arch/s390/kernel/vmlinux.lds.S
arch/sh/kernel/vmlinux.lds.S
arch/sparc/kernel/vmlinux.lds.S
arch/sparc64/kernel/vmlinux.lds.S
arch/um/kernel/vmlinux.lds.S
arch/v850/kernel/vmlinux.lds.S
arch/x86_64/kernel/vmlinux.lds.S

--- cygwin/scripts/Makefile.build-orig
+++ cygwin/scripts/Makefile.build
@@ -200,6 +200,9 @@
%.s: %.S FORCE
$(call if_changed_dep,as_s_S)

+%.s: %.S.h FORCE
+ $(call if_changed_dep,as_s_S)
+
quiet_cmd_as_o_S = AS $(quiet_modtag) $@
cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<

2. Command line length patch

If the list of modules is long enough, modpost on cygwin fails.
scripts/modpost is used to generate <modname>.mod.c files used for
versioning.

The long list seems to be caused by (combination of) if_changed macro
expansion and the actual list of modules being long enough. The
workaround calls $(cmd_modpost) unconditionally for cygwin and leaves
other hosts unchanged.

There's surely a better fix for this, I didn't understand the details
of if_changed macro enough to come up with one.

--- cygwin/scripts/Makefile.modpost-orig
+++ cygwin/scripts/Makefile.modpost

@@ -46,7 +46,21 @@

_modpost: $(modules)

+#
+# XXX cygwin hosts have issues with the length of command line
+# parameters. The if_changed macro expansion and the actual command
+# ends up exceeding the POSIX (?) limit of 32 K characters
+# so let's try running the command unconditionally
+#
+
+BUILD_HOST := $(shell uname | tr '[A-Z]' '[a-z]')

+ifeq "$(findstring cygwin, $(BUILD_HOST))" "cygwin"
+MODPOST_COMMAND = $(cmd_modpost)
+else
+MODPOST_COMMAND = $(call if_changed,modpost)
+endif
+
# Step 2), invoke modpost
# Includes step 3,4
quiet_cmd_modpost = MODPOST
@@ -56,7 +70,7 @@

.PHONY: __modpost
__modpost: $(wildcard vmlinux) $(modules:.ko=.o) FORCE
- $(call cmd,modpost)
+ $(MODPOST_COMMAND)

# Declare generated files as targets for modpost
$(symverfile): __modpost ;

3. Some cygwin versions may need <sys/types.h>

Older versions of cygwin lack inttypes.h, so include <sys/types.h> as
needed.

--- cygwin/arch/ppc/boot/utils/mkbugboot.c-orig
+++ cygwin/arch/ppc/boot/utils/mkbugboot.c

@@ -21,6 +21,11 @@
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
+#if defined(__CYGWIN__)
+#include <sys/types.h>
+#else
+#include <inttypes.h>
+#endif

#ifdef __i386__
#define cpu_to_be32(x) le32_to_cpu(x)
@@ -49,11 +54,6 @@
/* size of read buffer */
#define SIZE 0x1000

-/* typedef long int32_t; */
-typedef unsigned long uint32_t;
-typedef unsigned short uint16_t;
-typedef unsigned char uint8_t;
-
/* PPCBUG ROM boot header */
typedef struct bug_boot_header {
uint8_t magic_word[4]; /* "BOOT" */

--- cygwin/lib/gen_crc32table.c-orig
+++ cygwin/lib/gen_crc32table.c

@@ -1,6 +1,10 @@
#include <stdio.h>
#include "crc32defs.h"
+#if defined(__CYGWIN__)
+#include <sys/types.h>
+#else
#include <inttypes.h>
+#endif

#define ENTRIES_PER_LINE 4

--- cygwin/scripts/sumversion.c-orig
+++ cygwin/scripts/sumversion.c

@@ -1,5 +1,9 @@
+#if defined(__CYGWIN__)
+#include <sys/types.h>
+#else
+#include <stdint.h>
+#endif
#include <netinet/in.h>
-#include <stdint.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>

Signed-off-by: Pragnesh Sampat <pragnesh.sampat@xxxxxxxxxxx> under
TS0086

-Pragnesh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/