2011-02-01 17:00:29

by Narendra K

[permalink] [raw]
Subject: Re: [PATCH] Fix build failure when CONFIG_NLS is set to 'm' by allmodconfig

On Fri, Jan 28, 2011 at 10:15:18PM +0530, Jesse Barnes wrote:
> > > > > Even on platforms that don't support ACPI or DMI ...
> > > > >
> > > > > 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 <[email protected]>
> > > > Subject: [PATCH V2] Fix build failure when CONFIG_NLS is set to 'm' by allmodconfig
> > >
> > > Hi,
> > >
> > > Please let me know if there are any concerns with Version 2 of the patch.
> > > If it looks good please consider it for inclusion.
> >
> > Hi Jesse,
> >
> > Please let me know if there are any concerns with this patch. If it is
> > acceptable, please consider this for inclusion.
>
> I think the fs stuff will have to get an ack from Al. If he doesn't
> like it, see my earlier mail for another suggestion.

[Resending as i missed copying Al]

Hi Al,

Please let me know if there are any concerns with this patch. If not,
please ack this patch.

I have attached the patch here for your reference.

From: Narendra K <[email protected]>
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 compile conditionally into
vmlinux by introducing a new config option CONFIG_NLS_BASE which is
selected by (ACPI || DMI || NLS).

Signed-off-by: Narendra K <[email protected]>
---
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-