Commit Graph

115 Commits

Author SHA1 Message Date
xgopilot
940c6f7625 feat: restrict //export different symbol names to baremetal targets only
- Modified cl/import.go to check LLGO_TARGET_BAREMETAL env var
- For baremetal targets: //export SymbolName allows different export name (TinyGo-style)
- For normal targets: //export SymbolName uses SymbolName as function name (standard Go)
- Set LLGO_TARGET_BAREMETAL=1 in internal/build/build.go when baremetal tag present
- Added test for normal targets in _demo/normal/export/
- Added CI test to verify both embedded and normal target behavior

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
2025-11-03 06:20:42 +00:00
xgopilot
060a2dea06 feat: support //export with different symbol names for embedded targets
Implements support for TinyGo-style //export directive that allows
exporting functions with symbol names different from the Go function name.

This is essential for embedded development where hardware specifications
require specific symbol names (e.g., ARM Cortex-M interrupt handlers like
LPSPI2_IRQHandler, SysTick_Handler).

Changes:
- Modified cl/import.go to support two export formats:
  1. //export ExportName (TinyGo-style, export name can differ from function name)
  2. //export FuncName ExportName (Go-style, explicit function and export names)
- Added test case in _demo/embedded/export_test/ with nm verification

Example usage:
  //export LPSPI2_IRQHandler
  func interruptLPSPI2() {
      // exported as LPSPI2_IRQHandler
  }

Fixes #1378

🤖 Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
2025-10-31 03:31:39 +00:00
Li Jie
3605eeeef7 export c header file for build library 2025-09-11 14:07:58 +08:00
Li Jie
729e5772a0 process //export with initLink 2025-09-11 08:53:17 +08:00
luoliwoshang
afee2beebe cl/instr:rm llgoAsmBase 2025-08-17 18:41:38 +08:00
luoliwoshang
a148964878 feat:llgo.Asm
test:asm test with `nop`
2025-08-17 16:50:16 +08:00
xushiwei
915cdf2c23 #1165 2025-06-23 22:01:42 +08:00
xushiwei
b7b6e3bc93 testFrom: use test.Diff 2025-06-23 21:14:26 +08:00
visualfc
c4f0dd124d cl: funcName check $bound 2025-05-15 21:12:18 +08:00
Li Jie
8512395985 AllocCStr allocates on heap 2025-04-11 16:28:48 +08:00
Li Jie
ed366568b4 move out c/cpp/py 2025-04-03 16:26:11 +08:00
Li Jie
1172e5bdce build: separate compiler and libs 2025-01-08 14:59:01 +08:00
Li Jie
b3f4716616 runtime: patch internal/filepathlite 2025-01-08 14:58:59 +08:00
Li Jie
03b469212e feat: upgrade to x/tools 0.28 2025-01-08 14:58:59 +08:00
Li Jie
c3407eac5e cgo: supports //export functions only calls in C 2024-11-27 20:24:53 +08:00
Li Jie
90763de93c cgo: supports c/go callback funcs 2024-11-27 18:41:56 +08:00
Li Jie
5380ffa471 cgo: ignore funcs won't be compiled 2024-11-27 18:41:56 +08:00
Li Jie
d6c527f662 cgo: support macros 2024-11-27 18:41:56 +08:00
Li Jie
9f0b3963cb cgo: support full cgo tags 2024-11-15 16:08:24 +08:00
Li Jie
a64f4219e9 cgo: full supports cgo preambles and auto compile c files 2024-11-14 23:44:25 +08:00
Li Jie
ec38943c53 cl: compile cgo 2024-11-13 20:32:08 +08:00
visualfc
2feb3e1d7a ssa: prog.linkname; abi llvm.LinkOnceAnyLinkage always 2024-08-20 21:11:27 +08:00
AN Long
bbeceae42e feat(py): Add Python tuple constructor helper 2024-08-14 21:45:46 +08:00
visualfc
3435b6c4a4 cl: makeInterface check instance named 2024-08-13 21:59:19 +08:00
xushiwei
d480bb3ecd library: crypto/md5 2024-07-30 02:07:19 +08:00
xushiwei
a5dff9fb15 library: os.ProcessState.String 2024-07-28 23:53:22 +08:00
xushiwei
6f82b36962 library os: openFileNolog 2024-07-19 23:19:59 +08:00
visualfc
830c40440f build: fix unsafe.Sizeof for llgo:type C 2024-07-17 18:49:18 +08:00
xushiwei
e138951e9e c.AllocaCStrs; ssa: AllocaU/ArrayAlloca/Times/AllocaCStrs 2024-07-12 21:40:13 +08:00
xushiwei
11682e487e c/os: fork/exec 2024-07-12 00:39:16 +08:00
xushiwei
d0b57535ed support: internal/oserror, io, io/fs 2024-07-11 18:20:12 +08:00
xushiwei
e4ae0980b4 x 2024-07-09 12:42:20 +08:00
xushiwei
e41da0d697 cl handleTypeDecl: typeBackground 2024-07-09 12:38:34 +08:00
visualfc
22a2cc564f cl: parser llgo:type C 2024-07-09 10:00:31 +08:00
xushiwei
e55e90db1a py.Str; py.FromCStr/FromCStrAndLen/FromGoString 2024-07-04 18:34:00 +08:00
luoliwoshang
6f678294a0 link:not exist method warning 2024-07-02 17:37:32 +08:00
xushiwei
fe18c35dab patch: Clone/Merge 2024-06-28 15:14:30 +08:00
xushiwei
48a1384197 patch: fmt, os, runtime, syscall, time 2024-06-26 17:17:10 +08:00
xushiwei
4385ca0966 patch: internal/abi 2024-06-25 14:02:25 +08:00
xushiwei
bfa4e08a4e cl: c.Func (llgo.funcAddr); demo: cppintf (how to use c++ interface) 2024-06-21 23:44:56 +08:00
xushiwei
b93fc3f028 patch internal/reflectlite; demo: sort.Ints 2024-06-21 11:02:28 +08:00
xushiwei
f8b0a7105b patch: reflect (type) 2024-06-20 14:17:37 +08:00
xushiwei
f7d7f81c49 library: strconv 2024-06-20 11:05:43 +08:00
xushiwei
607deaa3c4 patch: syscall 2024-06-20 02:55:26 +08:00
xushiwei
3ead4b4d4b llgo.string; c string library 2024-06-19 23:40:05 +08:00
xushiwei
3c0e321538 patch: io, io/fs, os 2024-06-19 22:21:44 +08:00
visualfc
d59075e897 build: instantiate generics 2024-06-18 19:26:52 +08:00
xushiwei
7a15cf1157 patch: errors (todo) 2024-06-18 13:50:55 +08:00
xushiwei
3b2e97a729 globalType: support typepatch 2024-06-18 00:06:40 +08:00
xushiwei
edaba44c87 c/pthread/sync.Mutex; sync.Mutex/Once; typepatch.IsPatched 2024-06-17 23:51:40 +08:00