Re: [PATCH] Fix build failure when CONFIG_NLS is set to 'm' byallmodconfig

From: Narendra_K
Date: Mon Jan 17 2011 - 14:29:58 EST


On Sat, Jan 15, 2011 at 02:39:49AM +0530, Stephen Rothwell wrote:
> Hi Narendra,
>
> On Fri, 14 Jan 2011 20:52:42 +0530 <Narendra_K@xxxxxxxx> wrote:
> >
> > This patch addresses the build failure described in this thread by
> > compiling fs/nls/nls_base.c always into vmlinux, thus making the base
> > nls functions available always.
>
> Even on platforms that don't support ACPI or DMI ...
>
> > From: Narendra K <narendra_k@xxxxxxxx>
> > Subject: [PATCH] Fix build failure when CONFIG_NLS is set to 'm' by allmodconfig
> >
> > This patch fixes the following build breakage introduced by the patch
> > PCI:export ACPI _DSM provided firmware instance number and string to sysfs.
> > (previously commit a6247cd4be20cb5439db5cb7b0b6cc67fdc8e2a2).
> >
> > http://marc.info/?l=linux-pci&m=129313294112736&w=1
> >
> > drivers/built-in.o: In function `T.647':
> > pci-label.c:(.text+0x28514): undefined reference to `utf16s_to_utf8s'
> >
> > This happens because 'make allmodconfig' sets CONFIG_NLS=m and makes
> > 'utf16s_to_utf8s` unavailable to drivers/pci/pci-label.o which is built
> > into vmlinux.
> >
> > This is fixed by making fs/nls/nls_base.c always compile as part of
> > vmlinux thus making the base nls functions available always.
> > +++ b/fs/nls/Makefile
> > @@ -2,7 +2,7 @@
> > # Makefile for native language support
> > #
> >
> > -obj-$(CONFIG_NLS) += nls_base.o
> > +obj-y += nls_base.o
>
> You should really restrict this to CONFIG_ACPI || CONFIG_DMI ||
> CONFIG_NLS ... maybe create a CONFIG_NLS_BASE that is selected by ACPI,
> DMI and NLS?

Hi Stephen,

Thank you for the suggestions.

I agree with your suggestion that we should compile nls_base.o
conditionally, only when ACPI || DMI || NLS. I have introduced a bew
config option CONFIG_NLS_BASE and made ACPI, DMI and NLS select it.

V1 -> V2:

1. Conditionally compile fs/nls/nls_base.c by introducing a new config
option CONFIG_NLS_BASE, which is selected by (ACPI || DMI || NLS).
Behavior of the rest of the files under fs/nls is not changed.

From: Narendra K <narendra_k@xxxxxxxx>
Subject: [PATCH V2] Fix build failure when CONFIG_NLS is set to 'm' by allmodconfig

This patch fixes the following build breakage introduced by the patch
PCI:export ACPI _DSM provided firmware instance number and string to sysfs.
(previously commit a6247cd4be20cb5439db5cb7b0b6cc67fdc8e2a2).

http://marc.info/?l=linux-pci&m=129313294112736&w=1

drivers/built-in.o: In function `T.647':
pci-label.c:(.text+0x28514): undefined reference to `utf16s_to_utf8s'

This happens because 'make allmodconfig' sets CONFIG_NLS=m and makes
'utf16s_to_utf8s` unavailable to drivers/pci/pci-label.o which is built
into vmlinux.

This is fixed by making fs/nls/nls_base.c compile conditionally into
vmlinux by introducing a new config option CONFIG_NLS_BASE which is
selected by (ACPI || DMI || NLS). This makes

Signed-off-by: Narendra K <narendra_k@xxxxxxxx>
---
fs/Makefile | 2 +-
fs/nls/Kconfig | 14 ++++++++++++++
fs/nls/Makefile | 2 +-
3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/fs/Makefile b/fs/Makefile
index a7f7cef..1e78b9b 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -86,7 +86,7 @@ obj-$(CONFIG_NFS_FS) += nfs/
obj-$(CONFIG_EXPORTFS) += exportfs/
obj-$(CONFIG_NFSD) += nfsd/
obj-$(CONFIG_LOCKD) += lockd/
-obj-$(CONFIG_NLS) += nls/
+obj-y += nls/
obj-$(CONFIG_SYSV_FS) += sysv/
obj-$(CONFIG_CIFS) += cifs/
obj-$(CONFIG_NCP_FS) += ncpfs/
diff --git a/fs/nls/Kconfig b/fs/nls/Kconfig
index a39edc4..2fb92e5 100644
--- a/fs/nls/Kconfig
+++ b/fs/nls/Kconfig
@@ -4,6 +4,7 @@

menuconfig NLS
tristate "Native language support"
+ select NLS_BASE
---help---
The base Native Language Support. A number of filesystems
depend on it (e.g. FAT, JOLIET, NT, BEOS filesystems), as well
@@ -17,6 +18,19 @@ menuconfig NLS

if NLS

+config NLS_BASE
+ bool "Base NLS functions"
+ depends on ACPI || DMI
+ default y
+ ---help---
+ The base NLS support functions which handle unicode traslations.
+
+ If unsure, say Y.
+
+ This config option is selected by ACPI && DMI && NLS as the
+ functions defined here are needed in vmlinux and if built as
+ module cause build issues.
+
config NLS_DEFAULT
string "Default NLS Option"
default "iso8859-1"
diff --git a/fs/nls/Makefile b/fs/nls/Makefile
index f499dd7..dde741f 100644
--- a/fs/nls/Makefile
+++ b/fs/nls/Makefile
@@ -2,7 +2,7 @@
# Makefile for native language support
#

-obj-$(CONFIG_NLS) += nls_base.o
+obj-$(CONFIG_NLS_BASE) += nls_base.o

obj-$(CONFIG_NLS_CODEPAGE_437) += nls_cp437.o
obj-$(CONFIG_NLS_CODEPAGE_737) += nls_cp737.o
--
1.7.3.1

With regards,
Narendra K--
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/