yamt commented on code in PR #1609:
URL: https://github.com/apache/nuttx-apps/pull/1609#discussion_r1129801836


##########
interpreters/wamr/Toolchain.defs:
##########
@@ -0,0 +1,149 @@
+############################################################################
+# apps/interpreters/wamr/Toolchain.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+# Wasm32 toolchain setting
+# Target: wasm32-unknown-wasi
+
+WCC ?= $(WASI_SDK_PATH)/bin/clang
+WAR ?= $(WASI_SDK_PATH)/bin/llvm-ar rcs
+WRC ?= wamrc
+WSYSROOT ?= $(TOPDIR)
+
+CFLAGS_STRIP = -fsanitize=kernel-address -fsanitize=address 
-fsanitize=undefined
+CFLAGS_STRIP += $(ARCHCPUFLAGS) $(ARCHCFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) 
$(ARCHOPTIMIZATION) $(EXTRAFLAGS)
+
+WCFLAGS += $(filter-out $(CFLAGS_STRIP),$(CFLAGS))
+WCFLAGS += --sysroot=$(WSYSROOT) -nostdlib -D__NuttX__

Review Comment:
   > > > it's awkward to use nostdlib while using wasi-sdk. is this 
intentional? why?
   > 
   > Yes, just wasi clang compiler to generate wasm ir
   > 
   > > > also, why do you use -D__NuttX__? does the wasm environment have 
anything NuttX specific? doesn't it somehow contradict the purpose of wasm?
   > 
   > It's just a demo for C language. If compiling C code to wasm, NuttX 
application depends on the definition of **NuttX**.
   
   do you mean to export some nuttx specific functionalities to wasm modules? 
what are they?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to