Add helper binary `exec1'
* .gitignore: New files.
* Makefile.in (mostlyclean_dirs): Add libexec, if its Makefile
exists.
* autogen.sh (do_git): Autoreconf in exec as well.
* configure.ac: Configure libexec on Android.
* exec/Makefile.in:
* exec/README:
* exec/config-mips.m4.in:
* exec/config.guess:
* exec/config.h.in:
* exec/config.sub:
* exec/configure:
* exec/configure.ac:
* exec/deps.mk:
* exec/exec.c (MIN, struct exec_open_command)
(struct exec_map_command, struct exec_jump_command)
(write_open_command, write_load_command, process_interpreter_1)
(process_interpreter, process_program_header, insert_args)
(exec_0):
* exec/exec.h (_EXEC_H_, struct elf_header_32)
(struct program_header_32, struct dt_entry_32)
(struct elf_header_64, struct program_header_64)
(struct dt_entry_64, struct exec_tracee):
* exec/exec1.c (main):
* exec/install-sh (scriptversion):
* exec/loader-aarch64.s (_start):
* exec/loader-armeabi.s (_start):
* exec/loader-mips64el.s (__start):
* exec/loader-mipsel.s (__start):
* exec/loader-x86.s (_start):
* exec/loader-x86_64.s (_start):
* exec/mipsel-user.h (_MIPSEL_USER_H_):
* exec/mipsfpu.c (MIPS_ABI_FP_ANY, fpu_reqs, valid_abi_p)
(fp_mode_for_abi, cpu_supports_fr0_p, determine_fpu_mode):
* exec/mipsfpu.h (_MIPSFPU_H_, FP_FR0):
* exec/test.c (print_usage, main):
* exec/trace.c (MAX_TRACEES, aarch64_set_regs, read_memory)
(user_alloca, user_copy, remove_tracee, handle_clone)
(syscall_trap_p, handle_exec, process_system_call, tracing_execve)
(after_fork, find_tracee, exec_waitpid, exec_init): New files.
* java/Makefile.in (CROSS_EXEC_BINS): Add exec1 and
loader.
($(CROSS_EXEC_BINS) &): New target.
2023-04-30 13:37:19 +00:00
|
|
|
### @configure_input@
|
|
|
|
|
|
|
|
# Copyright (C) 2023 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
# This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
# GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
# GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
# Configure build directory information.
|
|
|
|
|
|
|
|
srcdir = @srcdir@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
builddir = @builddir@
|
|
|
|
|
|
|
|
# Set up compilation tools.
|
|
|
|
|
|
|
|
CC = @CC@
|
|
|
|
AS = @AS@
|
|
|
|
LD = @LD@
|
|
|
|
M4 = @M4@
|
|
|
|
CPP = @CPP@
|
|
|
|
ASFLAGS = @ASFLAGS@
|
|
|
|
ARFLAGS = @ARFLAGS@
|
|
|
|
CFLAGS = @CFLAGS@
|
|
|
|
CPPFLAGS = @CPPFLAGS@
|
|
|
|
LDFLAGS = @LDFLAGS@
|
|
|
|
LOADERFLAGS = @LOADERFLAGS@
|
|
|
|
FIND_DELETE = @FIND_DELETE@
|
|
|
|
|
|
|
|
# Set up object files.
|
|
|
|
|
|
|
|
LOADER = @exec_loader@
|
|
|
|
OBJS = @OBJS@
|
|
|
|
LOADOBJS = $(patsubst %.s,%.o,$(LOADER))
|
|
|
|
|
|
|
|
# Set up automatic dependency tracking.
|
|
|
|
|
|
|
|
AUTO_DEPEND = @AUTO_DEPEND@
|
|
|
|
DEPDIR = deps
|
|
|
|
ifeq ($(AUTO_DEPEND),yes)
|
|
|
|
DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d -MP
|
|
|
|
-include $(OBJS:%.o=$(DEPDIR)/%.d)
|
|
|
|
-include $(DEPDIR)/test.d
|
|
|
|
-include $(DEPDIR)/exec1.d
|
|
|
|
else
|
|
|
|
DEPFLAGS =
|
|
|
|
include $(srcdir)/deps.mk
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Set up the appropriate targets.
|
|
|
|
|
|
|
|
all: libexec.a loader
|
|
|
|
|
|
|
|
# Set up automatic Makefile regeneration.
|
|
|
|
|
|
|
|
$(srcdir)/configure: $(srcdir)/configure.ac
|
|
|
|
cd $(srcdir) && autoreconf
|
|
|
|
|
|
|
|
config.status: $(srcdir)/configure
|
|
|
|
if [ -x config.status ]; then \
|
|
|
|
./config.status --recheck; \
|
|
|
|
else \
|
|
|
|
$(srcdir)/configure; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
Makefile: config.status Makefile.in
|
|
|
|
MAKE="$(MAKE)" ./config.status
|
|
|
|
|
|
|
|
# Set up rules to build targets.
|
|
|
|
|
|
|
|
.SUFFIXES: .c .s
|
|
|
|
.c.o:
|
2023-05-02 08:44:46 +00:00
|
|
|
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEPFLAGS) -I. -I$(srcdir) $< -o $@
|
Add helper binary `exec1'
* .gitignore: New files.
* Makefile.in (mostlyclean_dirs): Add libexec, if its Makefile
exists.
* autogen.sh (do_git): Autoreconf in exec as well.
* configure.ac: Configure libexec on Android.
* exec/Makefile.in:
* exec/README:
* exec/config-mips.m4.in:
* exec/config.guess:
* exec/config.h.in:
* exec/config.sub:
* exec/configure:
* exec/configure.ac:
* exec/deps.mk:
* exec/exec.c (MIN, struct exec_open_command)
(struct exec_map_command, struct exec_jump_command)
(write_open_command, write_load_command, process_interpreter_1)
(process_interpreter, process_program_header, insert_args)
(exec_0):
* exec/exec.h (_EXEC_H_, struct elf_header_32)
(struct program_header_32, struct dt_entry_32)
(struct elf_header_64, struct program_header_64)
(struct dt_entry_64, struct exec_tracee):
* exec/exec1.c (main):
* exec/install-sh (scriptversion):
* exec/loader-aarch64.s (_start):
* exec/loader-armeabi.s (_start):
* exec/loader-mips64el.s (__start):
* exec/loader-mipsel.s (__start):
* exec/loader-x86.s (_start):
* exec/loader-x86_64.s (_start):
* exec/mipsel-user.h (_MIPSEL_USER_H_):
* exec/mipsfpu.c (MIPS_ABI_FP_ANY, fpu_reqs, valid_abi_p)
(fp_mode_for_abi, cpu_supports_fr0_p, determine_fpu_mode):
* exec/mipsfpu.h (_MIPSFPU_H_, FP_FR0):
* exec/test.c (print_usage, main):
* exec/trace.c (MAX_TRACEES, aarch64_set_regs, read_memory)
(user_alloca, user_copy, remove_tracee, handle_clone)
(syscall_trap_p, handle_exec, process_system_call, tracing_execve)
(after_fork, find_tracee, exec_waitpid, exec_init): New files.
* java/Makefile.in (CROSS_EXEC_BINS): Add exec1 and
loader.
($(CROSS_EXEC_BINS) &): New target.
2023-04-30 13:37:19 +00:00
|
|
|
.s.o:
|
2023-05-01 03:28:22 +00:00
|
|
|
$(M4) $< > $(notdir $<).s
|
|
|
|
$(AS) $(ASFLAGS) $(notdir $<).s -o $@
|
Add helper binary `exec1'
* .gitignore: New files.
* Makefile.in (mostlyclean_dirs): Add libexec, if its Makefile
exists.
* autogen.sh (do_git): Autoreconf in exec as well.
* configure.ac: Configure libexec on Android.
* exec/Makefile.in:
* exec/README:
* exec/config-mips.m4.in:
* exec/config.guess:
* exec/config.h.in:
* exec/config.sub:
* exec/configure:
* exec/configure.ac:
* exec/deps.mk:
* exec/exec.c (MIN, struct exec_open_command)
(struct exec_map_command, struct exec_jump_command)
(write_open_command, write_load_command, process_interpreter_1)
(process_interpreter, process_program_header, insert_args)
(exec_0):
* exec/exec.h (_EXEC_H_, struct elf_header_32)
(struct program_header_32, struct dt_entry_32)
(struct elf_header_64, struct program_header_64)
(struct dt_entry_64, struct exec_tracee):
* exec/exec1.c (main):
* exec/install-sh (scriptversion):
* exec/loader-aarch64.s (_start):
* exec/loader-armeabi.s (_start):
* exec/loader-mips64el.s (__start):
* exec/loader-mipsel.s (__start):
* exec/loader-x86.s (_start):
* exec/loader-x86_64.s (_start):
* exec/mipsel-user.h (_MIPSEL_USER_H_):
* exec/mipsfpu.c (MIPS_ABI_FP_ANY, fpu_reqs, valid_abi_p)
(fp_mode_for_abi, cpu_supports_fr0_p, determine_fpu_mode):
* exec/mipsfpu.h (_MIPSFPU_H_, FP_FR0):
* exec/test.c (print_usage, main):
* exec/trace.c (MAX_TRACEES, aarch64_set_regs, read_memory)
(user_alloca, user_copy, remove_tracee, handle_clone)
(syscall_trap_p, handle_exec, process_system_call, tracing_execve)
(after_fork, find_tracee, exec_waitpid, exec_init): New files.
* java/Makefile.in (CROSS_EXEC_BINS): Add exec1 and
loader.
($(CROSS_EXEC_BINS) &): New target.
2023-04-30 13:37:19 +00:00
|
|
|
|
|
|
|
# Set up dependencies for config-mips.m4.
|
|
|
|
|
|
|
|
config-mips.m4: config-mips.m4.in
|
|
|
|
cd $(srcdir) && ./config.status $@
|
|
|
|
$(LOADOBJS): config-mips.m4
|
|
|
|
|
|
|
|
# Set up rules to build libexec.a.
|
|
|
|
|
|
|
|
libexec.a: $(OBJS)
|
|
|
|
$(AR) cru $(ARFLAGS) $@ $^
|
|
|
|
|
|
|
|
# And loader.
|
|
|
|
|
|
|
|
loader: $(LOADOBJS)
|
|
|
|
$(LD) -o $@ $(LOADERFLAGS) $(LOADOBJS)
|
|
|
|
|
|
|
|
# And test.
|
|
|
|
|
|
|
|
test: test.o libexec.a
|
|
|
|
$(CC) $(LDFLAGS) $< libexec.a -o $@
|
|
|
|
|
|
|
|
# And exec1.
|
|
|
|
|
|
|
|
exec1: exec1.o libexec.a
|
|
|
|
$(CC) $(LDFLAGS) $< libexec.a -o $@
|
|
|
|
|
|
|
|
# Set up targets for cleaning.
|
|
|
|
|
2023-05-02 23:53:38 +00:00
|
|
|
.PHONY: clean distclean maintainer-clean extraclean bootstrap-clean
|
Add helper binary `exec1'
* .gitignore: New files.
* Makefile.in (mostlyclean_dirs): Add libexec, if its Makefile
exists.
* autogen.sh (do_git): Autoreconf in exec as well.
* configure.ac: Configure libexec on Android.
* exec/Makefile.in:
* exec/README:
* exec/config-mips.m4.in:
* exec/config.guess:
* exec/config.h.in:
* exec/config.sub:
* exec/configure:
* exec/configure.ac:
* exec/deps.mk:
* exec/exec.c (MIN, struct exec_open_command)
(struct exec_map_command, struct exec_jump_command)
(write_open_command, write_load_command, process_interpreter_1)
(process_interpreter, process_program_header, insert_args)
(exec_0):
* exec/exec.h (_EXEC_H_, struct elf_header_32)
(struct program_header_32, struct dt_entry_32)
(struct elf_header_64, struct program_header_64)
(struct dt_entry_64, struct exec_tracee):
* exec/exec1.c (main):
* exec/install-sh (scriptversion):
* exec/loader-aarch64.s (_start):
* exec/loader-armeabi.s (_start):
* exec/loader-mips64el.s (__start):
* exec/loader-mipsel.s (__start):
* exec/loader-x86.s (_start):
* exec/loader-x86_64.s (_start):
* exec/mipsel-user.h (_MIPSEL_USER_H_):
* exec/mipsfpu.c (MIPS_ABI_FP_ANY, fpu_reqs, valid_abi_p)
(fp_mode_for_abi, cpu_supports_fr0_p, determine_fpu_mode):
* exec/mipsfpu.h (_MIPSFPU_H_, FP_FR0):
* exec/test.c (print_usage, main):
* exec/trace.c (MAX_TRACEES, aarch64_set_regs, read_memory)
(user_alloca, user_copy, remove_tracee, handle_clone)
(syscall_trap_p, handle_exec, process_system_call, tracing_execve)
(after_fork, find_tracee, exec_waitpid, exec_init): New files.
* java/Makefile.in (CROSS_EXEC_BINS): Add exec1 and
loader.
($(CROSS_EXEC_BINS) &): New target.
2023-04-30 13:37:19 +00:00
|
|
|
clean:
|
2023-06-19 00:56:49 +00:00
|
|
|
rm -f *.o *.a loader test exec1 *.s.s
|
Add helper binary `exec1'
* .gitignore: New files.
* Makefile.in (mostlyclean_dirs): Add libexec, if its Makefile
exists.
* autogen.sh (do_git): Autoreconf in exec as well.
* configure.ac: Configure libexec on Android.
* exec/Makefile.in:
* exec/README:
* exec/config-mips.m4.in:
* exec/config.guess:
* exec/config.h.in:
* exec/config.sub:
* exec/configure:
* exec/configure.ac:
* exec/deps.mk:
* exec/exec.c (MIN, struct exec_open_command)
(struct exec_map_command, struct exec_jump_command)
(write_open_command, write_load_command, process_interpreter_1)
(process_interpreter, process_program_header, insert_args)
(exec_0):
* exec/exec.h (_EXEC_H_, struct elf_header_32)
(struct program_header_32, struct dt_entry_32)
(struct elf_header_64, struct program_header_64)
(struct dt_entry_64, struct exec_tracee):
* exec/exec1.c (main):
* exec/install-sh (scriptversion):
* exec/loader-aarch64.s (_start):
* exec/loader-armeabi.s (_start):
* exec/loader-mips64el.s (__start):
* exec/loader-mipsel.s (__start):
* exec/loader-x86.s (_start):
* exec/loader-x86_64.s (_start):
* exec/mipsel-user.h (_MIPSEL_USER_H_):
* exec/mipsfpu.c (MIPS_ABI_FP_ANY, fpu_reqs, valid_abi_p)
(fp_mode_for_abi, cpu_supports_fr0_p, determine_fpu_mode):
* exec/mipsfpu.h (_MIPSFPU_H_, FP_FR0):
* exec/test.c (print_usage, main):
* exec/trace.c (MAX_TRACEES, aarch64_set_regs, read_memory)
(user_alloca, user_copy, remove_tracee, handle_clone)
(syscall_trap_p, handle_exec, process_system_call, tracing_execve)
(after_fork, find_tracee, exec_waitpid, exec_init): New files.
* java/Makefile.in (CROSS_EXEC_BINS): Add exec1 and
loader.
($(CROSS_EXEC_BINS) &): New target.
2023-04-30 13:37:19 +00:00
|
|
|
ifeq ($(AUTO_DEPEND),yes)
|
|
|
|
rm -rf deps/*.d
|
|
|
|
endif
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -f Makefile config.status config.h config-mips.m4
|
|
|
|
|
|
|
|
maintainer-clean: distclean
|
|
|
|
|
|
|
|
### This doesn't actually appear in the coding standards, but Karl
|
|
|
|
### says GCC supports it, and that's where the configuration part of
|
|
|
|
### the coding standards seem to come from. It's like distclean, but
|
|
|
|
### it deletes backup and autosave files too.
|
|
|
|
|
|
|
|
extraclean: maintainer-clean
|
|
|
|
-rm -f config-tmp-* $(srcdir)/aclocal.m4 $(srcdir)/configure \
|
|
|
|
$(srcdir)/src/config.in
|
|
|
|
-[ "$(srcdir)" = "." ] || \
|
|
|
|
find $(srcdir) '(' -name '*~' -o -name '#*' ')' $(FIND_DELETE)
|
|
|
|
-find . '(' -name '*~' -o -name '#*' ')' $(FIND_DELETE)
|
2023-05-02 23:53:38 +00:00
|
|
|
bootstrap-clean: extraclean
|