Skip to content

Commit

Permalink
linux: Move emulator files around a little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed Nov 8, 2024
1 parent 262db3f commit dbe79f5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/StaticLibLinux.xcconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "StaticLib.xcconfig"

HEADER_SEARCH_PATHS = $(SRCROOT)/deps/linux/arch/ish/include $(MESON_BUILD_DIR)/deps/linux/arch/ish/include/generated $(SRCROOT)/deps/linux/include $(MESON_BUILD_DIR)/deps/linux/include $(SRCROOT)/deps/linux/arch/ish/include/uapi $(MESON_BUILD_DIR)/deps/linux/arch/ish/include/generated/uapi $(SRCROOT)/deps/linux/include/uapi $(MESON_BUILD_DIR)/deps/linux/arch/ish/include/generated/uapi $(SRCROOT)/deps/linux/arch/ish/include/ishemu $(SRCROOT)
HEADER_SEARCH_PATHS = $(SRCROOT)/deps/linux/arch/ish/include $(MESON_BUILD_DIR)/deps/linux/arch/ish/include/generated $(SRCROOT)/deps/linux/include $(MESON_BUILD_DIR)/deps/linux/include $(SRCROOT)/deps/linux/arch/ish/include/uapi $(MESON_BUILD_DIR)/deps/linux/arch/ish/include/generated/uapi $(SRCROOT)/deps/linux/include/uapi $(MESON_BUILD_DIR)/deps/linux/arch/ish/include/generated/uapi $(SRCROOT)/deps/linux/arch/ish/emu/ishemu/include $(SRCROOT)
GCC_PREPROCESSOR_DEFINITIONS = __KERNEL__
OTHER_CFLAGS = -U__weak -include $(SRCROOT)/deps/linux/include/linux/kconfig.h -include $(SRCROOT)/deps/linux/include/linux/compiler_types.h -Wno-gnu-variable-sized-type-not-at-end -Wno-conditional-uninitialized
// disable modules because it results in clashes between linux and clang headers
Expand Down
8 changes: 4 additions & 4 deletions deps/linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ output="$1"
srctree="$2"
objtree="$3"
depfile="$4"
export ARCH=ish

# https://stackoverflow.com/a/3572105/1455016
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}

makeargs=()
makeargs+=("ARCH=ish")
if [[ -n "$HOSTCC" ]]; then
makeargs+=("HOSTCC=$HOSTCC")
fi
Expand All @@ -22,8 +22,8 @@ makeargs+=("LLVM_IAS=1")

mkdir -p "$objtree"
cat >"$(realpath "$objtree/meson_vars.mk")" <<END
export ISH_CFLAGS = $ISH_CFLAGS
export LIB_ISH_EMU = $LIB_ISH_EMU
export ISH_SRC = $ISH_SRC
export ISH_BUILD = $ISH_BUILD
END

defconfig="$srctree/arch/ish/configs/ish_defconfig"
Expand All @@ -46,5 +46,5 @@ esac

make -C "$srctree" O="$(realpath "$objtree")" "${makeargs[@]}" olddefconfig

make -C "$objtree" -j "$cpus" "${makeargs[@]}" all compile_commands.json --debug=v | "$srctree/../makefilter.py" "$depfile" "$output" "$objtree"
(set -x; make -C "$objtree" -j "$cpus" "${makeargs[@]}" all compile_commands.json --debug=v) | "$srctree/../makefilter.py" "$depfile" "$output" "$objtree"
cp "$objtree/vmlinux" "$output"
6 changes: 3 additions & 3 deletions deps/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ if get_option('kernel') == 'linux'
'HOSTCC='+ ' '.join(meson.get_compiler('c', native: true).cmd_array() + get_option('build.c_args')),
'CC='+ ' '.join(meson.get_compiler('c', native: false).cmd_array() + get_option('c_args')),
# hack to find the right directories because meson is bad
'ISH_CFLAGS='+ '-I'+meson.project_source_root(),
'LIB_ISH_EMU='+ meson.project_build_root() / 'libish_emu.a',
'ISH_SRC='+ meson.project_source_root(),
'ISH_BUILD='+ meson.project_build_root(),
'KCONFIG_FRAGMENTS='+ ' '.join([
meson.project_source_root() / 'deps/linux.config',
meson.project_build_root() / 'deps/linux-meson.config',
Expand Down Expand Up @@ -46,7 +46,7 @@ if get_option('kernel') == 'linux'
include_directories: [include_directories(
'linux/arch/ish/include',
'linux/arch/ish/include/generated',
'linux/arch/ish/include/ishemu',
'linux/arch/ish/emu/ishemu/include',
'linux/include',
'linux/arch/ish/include/uapi',
'linux/arch/ish/include/generated/uapi',
Expand Down

0 comments on commit dbe79f5

Please sign in to comment.