Skip to contentSkip to conversation

Makefile: disable parallel build with dtc

PATCH In review Michael S. Tsirkin 3 participants 5 messages Jul 4, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: disable parallel build with dtc

Sometimes I get this error when building with -j 4:
ar: two different operation options specified make[1]: *** [libfdt/libfdt.a] Error 1
make: *** [subdir-dtc] Error 2

dtc make does not seem to support parallel make. Force non-parallel build to fix this.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index c06bfab..e86c15a 100644
@@ -145,7 +145,7 @@ pixman/Makefile: $(SRC_PATH)/pixman/configure
 $(SRC_PATH)/pixman/configure:
 	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
 
-DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
+DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt --jobs=1
 DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
 DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
 
Signature · 1 line
MST
#1 lore raw
Quoted 7 lines · Michael S. Tsirkin

Sometimes I get this error when building with -j 4:
ar: two different operation options specified make[1]: *** [libfdt/libfdt.a] Error 1
make: *** [subdir-dtc] Error 2

dtc make does not seem to support parallel make. Force non-parallel build to fix this.

So, this is the second time somebody's reported this, and I think it would be better to try to figure out what's going on. Can you report what the actual ar command is when run with V=1 ?

Also, can you confirm that you haven't got an environment that sets ARFLAGS to something weird (including "") ?

thanks
-- PMM

#2 lore raw

Am 04.07.2013 11:17, schrieb Peter Maydell:

Quoted 9 lines · Michael S. Tsirkin
Quoted 7 lines

Sometimes I get this error when building with -j 4:
ar: two different operation options specified make[1]: *** [libfdt/libfdt.a] Error 1
make: *** [subdir-dtc] Error 2

dtc make does not seem to support parallel make. Force non-parallel build to fix this.

Quoted 7 lines

So, this is the second time somebody's reported this, and I think it would be better to try to figure out what's going on. Can you report what the actual ar command is when run with V=1 ?

Also, can you confirm that you haven't got an environment that sets ARFLAGS to something weird (including "") ?

I did confirm that my environment does not have ARFLAGS set; I believe the issue is that ARFLAGS="$(ARFLAGS)" is being passed in the Makefile, effectively setting it to "".

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#4 lore raw
In reply to Peter Maydell
Quoted 6 lines · Peter Maydell
Quoted 5 lines · Michael S. Tsirkin

Sometimes I get this error when building with -j 4:
ar: two different operation options specified make[1]: *** [libfdt/libfdt.a] Error 1
make: *** [subdir-dtc] Error 2

Quoted 7 lines
Quoted 2 lines

dtc make does not seem to support parallel make. Force non-parallel build to fix this.

So, this is the second time somebody's reported this, and I think it would be better to try to figure out what's going on. Can you report what the actual ar command is when run with V=1 ?

it stopped reproducing now :(

Quoted 5 lines

Also, can you confirm that you haven't got an environment that sets ARFLAGS to something weird (including "") ?

thanks
-- PMM

I can confirm that.

#3 lore raw
In reply to Andreas Färber
Quoted 7 lines · Andreas Färber

Am 04.07.2013 11:17, schrieb Peter Maydell:

Quoted 2 lines

Also, can you confirm that you haven't got an environment that sets ARFLAGS to something weird (including "") ?

I did confirm that my environment does not have ARFLAGS set; I believe the issue is that ARFLAGS="$(ARFLAGS)" is being passed in the Makefile, effectively setting it to "".

That should set it to "rv", because the top level make will default ARFLAGS to that if you haven't set it explicitly.

You can test this by seeing whether a V=1 build runs the libfdt make with ARFLAGS="rv" or something else:

cam-vm-266:precise:qemu$ make -C build/x86 -j4 V=1
make: Entering directory `/home/petmay01/linaro/qemu-from-laptop/qemu/build/x86' make -I/home/petmay01/linaro/qemu-from-laptop/qemu/dtc VPATH=/home/petmay01/linaro/qemu-from-laptop/qemu/dtc -C dtc V="1" LIBFDT_srcdir=/home/petmay01/linaro/qemu-from-laptop/qemu/dtc/libfdt CPPFLAGS="-I/home/petmay01/linaro/qemu-from-laptop/qemu/build/x86/dtc -I/home/petmay01/linaro/qemu-from-laptop/qemu/dtc -I/home/petmay01/linaro/qemu-from-laptop/qemu/dtc/libfdt" CFLAGS="-O2 -D_FORTIFY_SOURCE=2 -g -Werror -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all
-I/usr/include/libpng12 -I/usr/include/pixman-1
-I/home/petmay01/linaro/qemu-from-laptop/qemu/dtc/libfdt -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/petmay01/linaro/qemu-from-laptop/qemu/tests" LDFLAGS="-Wl,--warn-common -m64 -static -g " ARFLAGS="rv" CC="ccache gcc" AR="ar" LD="ld" BUILD_DIR=/home/petmay01/linaro/qemu-from-laptop/qemu/build/x86 libfdt/libfdt.a
make[1]: Entering directory `/home/petmay01/linaro/qemu-from-laptop/qemu/build/x86/dtc'

(this is GNU Make 3.81 from ubuntu package 3.81-8.1ubuntu1.1)

-- PMM