Skip to content

Commit

Permalink
Add nasm (#1042)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vertexwahn authored Oct 20, 2023
1 parent 8882221 commit d42eef6
Show file tree
Hide file tree
Showing 8 changed files with 1,291 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/nasm/2.14.02/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module(
name = "nasm",
version = "2.14.02",
compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.8")
145 changes: 145 additions & 0 deletions modules/nasm/2.14.02/patches/add_build_file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
--- BUILD.bazel
+++ BUILD.bazel
@@ -0,0 +1,142 @@
+# Copied from https://github.com/tensorflow/tensorflow/blob/master/third_party/nasm/nasm.BUILD
+# The copied code is available under the Apache-2.0 license
+# Copyright of the copied code belongs to the TensorFlow Authors
+
+licenses(["notice"])
+
+exports_files(["LICENSE"])
+
+INCLUDES = [
+ ".",
+ "include",
+ "x86",
+ "asm",
+ "disasm",
+ "output",
+]
+
+COPTS = select({
+ "@platforms//os:windows": [],
+ "//conditions:default": [
+ "-w",
+ "-DHAVE_CONFIG_H",
+ ],
+})
+
+cc_library(
+ name = "nasm_2_14_02",
+ srcs = [
+ "asm/assemble.c",
+ "asm/directbl.c",
+ "asm/directiv.c",
+ "asm/error.c",
+ "asm/eval.c",
+ "asm/exprdump.c",
+ "asm/exprlib.c",
+ "asm/float.c",
+ "asm/labels.c",
+ "asm/listing.c",
+ "asm/parser.c",
+ "asm/pptok.c",
+ "asm/pragma.c",
+ "asm/preproc.c",
+ "asm/preproc-nop.c",
+ "asm/quote.c",
+ "asm/rdstrnum.c",
+ "asm/segalloc.c",
+ "asm/stdscan.c",
+ "asm/strfunc.c",
+ "asm/tokhash.c",
+ "common/common.c",
+ "disasm/disasm.c",
+ "disasm/sync.c",
+ "macros/macros.c",
+ "nasmlib/badenum.c",
+ "nasmlib/bsi.c",
+ "nasmlib/crc64.c",
+ "nasmlib/errfile.c",
+ "nasmlib/file.c",
+ "nasmlib/filename.c",
+ "nasmlib/hashtbl.c",
+ "nasmlib/ilog2.c",
+ "nasmlib/malloc.c",
+ "nasmlib/md5c.c",
+ "nasmlib/mmap.c",
+ "nasmlib/path.c",
+ "nasmlib/perfhash.c",
+ "nasmlib/raa.c",
+ "nasmlib/rbtree.c",
+ "nasmlib/readnum.c",
+ "nasmlib/realpath.c",
+ "nasmlib/saa.c",
+ "nasmlib/srcfile.c",
+ "nasmlib/string.c",
+ "nasmlib/strlist.c",
+ "nasmlib/ver.c",
+ "output/codeview.c",
+ "output/legacy.c",
+ "output/nulldbg.c",
+ "output/nullout.c",
+ "output/outaout.c",
+ "output/outas86.c",
+ "output/outbin.c",
+ "output/outcoff.c",
+ "output/outdbg.c",
+ "output/outelf.c",
+ "output/outform.c",
+ "output/outieee.c",
+ "output/outlib.c",
+ "output/outmacho.c",
+ "output/outobj.c",
+ "output/outrdf2.c",
+ "output/strtbl.c",
+ "stdlib/snprintf.c",
+ "stdlib/strlcpy.c",
+ "stdlib/strnlen.c",
+ "stdlib/strrchrnul.c",
+ "stdlib/vsnprintf.c",
+ "x86/disp8.c",
+ "x86/iflag.c",
+ "x86/insnsa.c",
+ "x86/insnsb.c",
+ "x86/insnsd.c",
+ "x86/insnsn.c",
+ "x86/regdis.c",
+ "x86/regflags.c",
+ "x86/regs.c",
+ "x86/regvals.c",
+ ],
+ hdrs = glob([
+ "*.h",
+ "include/*.h",
+ "x86/*.h",
+ "disasm/*.h",
+ "config/*.h",
+ "asm/*.h",
+ "output/*.h",
+ "nasmlib/*.h",
+ ]),
+ copts = COPTS,
+ includes = INCLUDES,
+)
+
+cc_binary(
+ name = "nasm",
+ srcs = [
+ "asm/nasm.c",
+ "nasmlib/zerobuf.c",
+ ],
+ copts = COPTS,
+ includes = INCLUDES,
+ visibility = ["//visibility:public"],
+ deps = [
+ ":nasm_2_14_02",
+ ],
+)
+
+config_setting(
+ name = "windows",
+ values = {
+ "cpu": "x64_windows",
+ },
+)
Loading

0 comments on commit d42eef6

Please sign in to comment.