Skip to content

Commit

Permalink
Merge snabbco#64 branch 'lukego/dwarf' into auditlog
Browse files Browse the repository at this point in the history
  • Loading branch information
lukego committed Jul 14, 2017
2 parents 0acc230 + 0a55469 commit 89407be
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
10 changes: 7 additions & 3 deletions raptorjit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ mkDerivation rec {
name = "raptorjit-${version}";
inherit version;
src = source;
buildInputs = [ luajit ]; # LuaJIT to bootstrap DynASM
buildInputs = [
luajit # LuaJIT to bootstrap DynASM
gcc6 # GCC for generating DWARF info
];
dontStrip = true; # No extra stripping (preserve debug info)
installPhase = ''
mkdir -p $out/bin
cp src/luajit $out/bin/raptorjit
install -D src/luajit $out/bin/raptorjit
install -D src/lj_dwarf.dwo $out/lib/raptorjit.dwo
'';

enableParallelBuilding = true; # Do 'make -j'
Expand Down
9 changes: 8 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ LJCORE_O= lj_gc.o lj_err.o lj_char.o lj_bc.o lj_obj.o lj_buf.o \
lj_lib.o lj_alloc.o lib_aux.o \
$(LJLIB_O) lib_init.o

DWARF_DWO= lj_dwarf.dwo

LJVMCORE_O= $(LJVM_O) $(LJCORE_O)
LJVMCORE_DYNO= $(LJVMCORE_O:.o=_dyn.o)

Expand Down Expand Up @@ -566,7 +568,7 @@ E= @echo
# Make targets.
##############################################################################

default all: $(TARGET_T)
default all: $(TARGET_T) $(DWARF_DWO)

clean:
$(HOST_RM) $(ALL_RM)
Expand Down Expand Up @@ -655,6 +657,11 @@ $(HOST_O): %.o: %.c
$(E) "HOSTCC $@"
$(Q)$(HOST_CC) $(HOST_ACFLAGS) -c -o $@ $<

$(DWARF_DWO): %.dwo: %.c
$(E) "CC(debug) $@"
# GCC because clang does not seem to produce decent debug info (?)
$(Q)gcc -g3 -gdwarf-4 -fno-eliminate-unused-debug-types -gsplit-dwarf -c $<

include Makefile.dep

##############################################################################
Expand Down
24 changes: 24 additions & 0 deletions src/lj_dwarf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
** Compilation unit for DWARF debug information.
*/

#include "lj_obj.h"
#include "lj_gc.h"
#include "lj_err.h"
#include "lj_debug.h"
#include "lj_str.h"
#include "lj_frame.h"
#include "lj_state.h"
#include "lj_bc.h"
#include "lj_ir.h"
#include "lj_jit.h"
#include "lj_iropt.h"
#include "lj_mcode.h"
#include "lj_trace.h"
#include "lj_snap.h"
#include "lj_gdbjit.h"
#include "lj_record.h"
#include "lj_asm.h"
#include "lj_dispatch.h"
#include "lj_vm.h"
#include "lj_target.h"

0 comments on commit 89407be

Please sign in to comment.