tools/power/acpi: Fix the compile error when output directory is specified
Subsystems (2)
PATCH 1/1 tools/power/acpi: Fix the compile error when output directory is specified
Compiling the tool when output directory parameter is specified would trigger the following error:
make O=/data/test/tmp/ -C tools/power/acpi/
make: Entering directory '/data/src/kernel/linux/tools/power/acpi'
DESCEND tools/acpidbg
make[1]: Entering directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'
MKDIR include CP include CC tools/acpidbg/acpidbg.o
Assembler messages:
Fatal error: can't create /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o: No such file or directory make[1]: *** [../../Makefile.rules:24: /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o] Error 1 make[1]: Leaving directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'
make: *** [Makefile:18: acpidbg] Error 2
make: Leaving directory '/data/src/kernel/linux/tools/power/acpi'
This is because the output directory has not been created yet. Fix this issue by creating the output directory before compiling.
--- tools/power/acpi/Makefile.config | 1 + tools/power/acpi/Makefile.rules | 1 + 2 files changed, 2 insertions(+)
tools/power/acpi/Makefile.config +1 -0
@@ -69,6 +69,7 @@ KERNEL_INCLUDE := $(OUTPUT)include ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE) CFLAGS += $(WARNINGS) +MKDIR = mkdir ifeq ($(strip $(V)),false) QUIET=@
tools/power/acpi/Makefile.rules +1 -0
@@ -21,6 +21,7 @@ $(KERNEL_INCLUDE): $(objdir)%.o: %.c $(KERNEL_INCLUDE) $(ECHO) " CC " $(subst $(OUTPUT),,$@) + $(QUIET) $(MKDIR) -p $(objdir) 2>/dev/null $(QUIET) $(CC) -c $(CFLAGS) -o $@ $< all: $(OUTPUT)$(TOOL)
Signature · 1 line
2.25.1
Quoted 18 lines · Chen Yu
Compiling the tool when output directory parameter is specified would trigger the following error:
make O=/data/test/tmp/ -C
tools/power/acpi/make: Entering directory '/data/src/kernel/linux/tools/power/acpi'
DESCENDtools/acpidbg
make[1]: Entering directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'MKDIR include CP include CC tools/acpidbg/acpidbg.oAssembler messages:
Fatal error: can't create /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o: No such file or directory make[1]: *** [../../Makefile.rules:24: /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o] Error 1 make[1]: Leaving directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'
make: *** [Makefile:18: acpidbg] Error 2
make: Leaving directory '/data/src/kernel/linux/tools/power/acpi'
Quoted 2 lines
This is because the output directory has not been created yet. Fix this issue by creating the output directory before compiling.
Thanks!
Quoted 24 lines
Reported-by Andy Shevchenko <[email protected]>Signed-off-by Chen Yu <[email protected]>--- tools/power/acpi/Makefile.config | 1 + tools/power/acpi/Makefile.rules | 1 + 2 files changed, 2 insertions(+)tools/power/acpi/Makefile.config +1
-0@@ -69,6 +69,7 @@ KERNEL_INCLUDE := $(OUTPUT)include ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE) CFLAGS += $(WARNINGS) +MKDIR = mkdir ifeq ($(strip $(V)),false) QUIET=@tools/power/acpi/Makefile.rules +0
-0
tools/power/acpi/Makefile.rules $(KERNEL_INCLUDE): · line 24
Quoted 4 lines
tools/power/acpi/Makefile.rules +1
-0@@ -21,6 +21,7 @@ $(KERNEL_INCLUDE): $(objdir)%.o: %.c $(KERNEL_INCLUDE) $(ECHO) " CC " $(subst $(OUTPUT),,$@) + $(QUIET) $(MKDIR) -p $(objdir) 2>/dev/null
Not sure we need the 2>/dev/null part.
Quoted 6 lines
tools/power/acpi/Makefile.rules +0
-0$(QUIET) $(CC) -c $(CFLAGS) -o $@ $< all: $(OUTPUT)$(TOOL)Signature · 1 line
2.25.1
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 19 lines · Andy Shevchenko
Quoted 18 lines · Chen Yu
Compiling the tool when output directory parameter is specified would trigger the following error:
make O=/data/test/tmp/ -C
tools/power/acpi/make: Entering directory '/data/src/kernel/linux/tools/power/acpi'
DESCENDtools/acpidbg
make[1]: Entering directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'MKDIR include CP include CC tools/acpidbg/acpidbg.oAssembler messages:
Fatal error: can't create /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o: No such file or directory make[1]: *** [../../Makefile.rules:24: /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o] Error 1 make[1]: Leaving directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'
make: *** [Makefile:18: acpidbg] Error 2
make: Leaving directory '/data/src/kernel/linux/tools/power/acpi'
Quoted 6 lines
Quoted 2 lines
This is because the output directory has not been created yet. Fix this issue by creating the output directory before compiling.
Reviewed-by Andy Shevchenko <[email protected]>Thanks!
Thanks for review.
Quoted 7 lines
tools/power/acpi/Makefile.rules $(KERNEL_INCLUDE): · line 24
Quoted 4 lines
$(objdir)%.o: %.c $(KERNEL_INCLUDE)
tools/power/acpi/Makefile.rules +1
-0$(ECHO) " CC " $(subst $(OUTPUT),,$@) + $(QUIET) $(MKDIR) -p $(objdir) 2>/dev/nullNot sure we need the
2>/dev/nullpart.
If the 'O=' is a read-only directory, mkdir would print errors and adding 2> would avoid printing it. So the user could focus on the real compile error.
without '2>' :
make O=/data/test/tmp -C tools/power/acpi/
make: Entering directory '/data/src/kernel/linux/tools/power/acpi'
DESCEND tools/acpidbg
mkdir: cannot create directory ‘/data/test/tmp/tools’: Permission denied
thanks,
Chenyu
Quoted 12 lines
Quoted 6 lines
$(QUIET) $(CC) -c $(CFLAGS) -o $@ $<
all: $(OUTPUT)$(TOOL)
Signature · 1 line
2.25.1Signature · 2 lines
With Best Regards, Andy Shevchenko
Rafael J. Wysocki
maintainerQuoted 46 lines · Chen Yu
Compiling the tool when output directory parameter is specified would trigger the following error:
make O=/data/test/tmp/ -C
tools/power/acpi/make: Entering directory '/data/src/kernel/linux/tools/power/acpi'
DESCENDtools/acpidbg
make[1]: Entering directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'MKDIR include CP include CC tools/acpidbg/acpidbg.oAssembler messages:
Fatal error: can't create /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o: No such file or directory make[1]: *** [../../Makefile.rules:24: /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o] Error 1 make[1]: Leaving directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'
make: *** [Makefile:18: acpidbg] Error 2
make: Leaving directory '/data/src/kernel/linux/tools/power/acpi'This is because the output directory has not been created yet. Fix this issue by creating the output directory before compiling.
Reported-by Andy Shevchenko <andriy.shevchenko(a)intel.com>Signed-off-by Chen Yu <yu.c.chen(a)intel.com>--- tools/power/acpi/Makefile.config | 1 + tools/power/acpi/Makefile.rules | 1 + 2 files changed, 2 insertions(+)tools/power/acpi/Makefile.config +1
-0@@ -69,6 +69,7 @@ KERNEL_INCLUDE := $(OUTPUT)include ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE) CFLAGS += $(WARNINGS) +MKDIR = mkdir ifeq ($(strip $(V)),false) QUIET=@tools/power/acpi/Makefile.rules +0
-0
tools/power/acpi/Makefile.rules $(KERNEL_INCLUDE):
Quoted 8 lines
tools/power/acpi/Makefile.rules +1
-1@@ -21,6 +21,7 @@ $(KERNEL_INCLUDE): $(objdir)%.o: %.c $(KERNEL_INCLUDE) $(ECHO) " CC " $(subst $(OUTPUT),,$@) + $(QUIET) $(MKDIR) -p $(objdir) 2>/dev/null $(QUIET) $(CC) -c $(CFLAGS) -o $@ $< all: $(OUTPUT)$(TOOL) --
Applied (with some edits in the subject and changelog) as 5.16-rc material.
Thanks!