[LEDE-DEV] Adding new targets/subtargets

Philip Prindeville philipp_subx at redfish-solutions.com
Mon Jan 2 11:54:04 PST 2017


> On Dec 31, 2016, at 6:23 PM, Philip Prindeville <philipp_subx at redfish-solutions.com> wrote:
> 
> There’s a test for “ifeq ($(ARCH),i386) … endif” but I don’t see code for x86_64.  Do we need something like:
> 
> diff --git a/include/target.mk b/include/target.mk
> index 8211ba0..5e3aae6 100644
> --- a/include/target.mk
> +++ b/include/target.mk
> @@ -227,6 +227,13 @@ ifeq ($(DUMP),1)
>     CPU_CFLAGS_pentium4 = -march=pentium4
>     CPU_CFLAGS_geode = -march=geode -mmmx -m3dnow
>   endif
> +  ifeq ($(ARCH),x86_64)
> +    CPU_TYPE ?= k8
> +    CPU_CFLAGS_k8 = -march=k8
> +    CPU_CFLAGS_core2 = -march=core2+crypto
> +    CPU_CFLAGS_i7 = -march=corei7
> +    CPU_CFLAGS_atom64 = -march=atom
> +  endif
>   ifneq ($(findstring arm,$(ARCH)),)
>     CPU_TYPE ?= xscale
>     CPU_CFLAGS_arm920t = -march=armv4t -mtune=arm920t


Actually, I tested this and it doesn’t quite work.

Tried to do some digging:


philip at ubuntu:~/bertram/bmu-philip/openwrt$ make -j1 target/linux/clean V=s DUMP=1
/bin/sh: 1: mindepth: not found
Collecting package info: doneing...
/bin/sh: 1: mindepth: not found
Collecting target info: doneing...
make: *** prereq: No such file or directory.  Stop.
make[4]: *** [prereq] Error 2
make[3]: *** [target/linux/prereq] Error 2
make[2]: *** [/home/philip/bertram/bmu-philip/openwrt/staging_dir/target-_-/stamp/.target_prereq] Error 2
make[1]: *** [prereq] Error 2
make: *** [target/linux/clean] Error 2
philip at ubuntu:~/bertram/bmu-philip/openwrt$


Okay, so that didn’t work…  So I try to write out $(ARCH) from inside include/target.mk and it looks like it’s set to “arm” even though I’m building the x86/64 target.


philip at ubuntu:~/bertram/bmu-philip/openwrt$ grep '^CONFIG_' .config | head
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
CONFIG_TARGET_x86=y
CONFIG_TARGET_x86_64=y
CONFIG_TARGET_x86_64_Generic=y
CONFIG_HAS_SUBTARGETS=y
CONFIG_TARGET_BOARD="x86"
CONFIG_TARGET_SUBTARGET="64"
CONFIG_TARGET_ARCH_PACKAGES="x86_64"
CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe"
philip at ubuntu:~/bertram/bmu-philip/openwrt$


so I don’t know how to go about root-causing this.

Is there an easy way to see what the target-related settings are from within include/target.mk?

Maybe add a target/xyzzy which writes to stdout all the settings?

-Philip




More information about the Lede-dev mailing list