Skip to content

Add solaris platform#7055

Merged
waruqi merged 19 commits intodevfrom
solaris
Nov 24, 2025
Merged

Add solaris platform#7055
waruqi merged 19 commits intodevfrom
solaris

Conversation

@waruqi
Copy link
Member

@waruqi waruqi commented Nov 22, 2025

  • Before adding new features and new modules, please go to issues to submit the relevant feature description first.
  • Write good commit messages and use the same coding conventions as the rest of the project.
  • Please commit code to dev branch and we will merge into master branch in feature
  • Ensure your edited codes with four spaces instead of TAB.

  • 增加新特性和新模块之前,请先到issues提交相关特性说明,经过讨论评估确认后,再进行相应的代码提交,避免做无用工作。
  • 编写友好可读的提交信息,并使用与工程代码相同的代码规范,代码请用4个空格字符代替tab缩进。
  • 请提交代码到dev分支,如果通过,我们会在特定时间合并到master分支上。
  • 为了规范化提交日志的格式,commit消息,不要用中文,请用英文描述。

@waruqi waruqi added this to the v3.0.5 milestone Nov 22, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @waruqi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive support for the Solaris operating system within the project. It ensures that Solaris is recognized and properly configured across documentation, core engine logic, and build system definitions, allowing for seamless development and compilation on Solaris platforms.

Highlights

  • README Documentation Updates: Both the English (README.md) and Chinese (README_zh.md) documentation files have been updated to include Solaris (i386, x86_64) in the list of officially supported platforms.
  • New Solaris Configuration Header: A new configuration header file, core/src/tbox/inc/solaris/tbox.config.h, has been added. This file defines various TB_CONFIG macros specific to the Solaris operating system, including details about available libc, libm, and POSIX functions, as well as general OS identification.
  • Core Engine Integration: The core/src/xmake/engine.c file has been modified to properly detect and handle Solaris. This includes updating OS-specific include directives, defining the XM_PROC_SELF_FILE path for Solaris, and mapping 'solaris' to the syshost variable for platform identification.
  • Xmake Platform Definition for Solaris: A dedicated platform definition file, xmake/platforms/solaris/xmake.lua, has been introduced. This file configures Xmake for Solaris, specifying supported architectures (i386, x86_64), standard output formats (static, object, shared, symbol), the default installation directory, and a list of compatible toolchains (e.g., gcc, clang, cuda, go, rust).
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/solaris.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds initial support for the Solaris platform. The changes include updates to README files, a new platform configuration for Solaris in xmake.lua, and necessary adjustments in the C source code to accommodate the new platform. The implementation is a good starting point. I've identified a few potential issues in the tbox configuration for Solaris regarding the availability of certain functions like flock and backtrace. I've also suggested some improvements for the platform definition file to make Solaris support more complete in the future, such as adding SPARC architecture and support for the native Oracle Developer Studio compiler. Additionally, there's a small redundancy in header includes that could be cleaned up.

#define TB_CONFIG_LIBC_HAVE_SETJMP 1
#define TB_CONFIG_LIBC_HAVE_SIGSETJMP 1
#define TB_CONFIG_LIBC_HAVE_KILL 1
#define TB_CONFIG_LIBC_HAVE_BACKTRACE 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The backtrace() function and <execinfo.h> are glibc extensions and are not standard on Solaris. Solaris provides printstack() in <ucontext.h> for a similar purpose. Enabling this macro will likely cause compilation errors. This should be undefined unless a compatibility library providing backtrace() is being used.

Suggested change
#define TB_CONFIG_LIBC_HAVE_BACKTRACE 1
/* #undef TB_CONFIG_LIBC_HAVE_BACKTRACE */

/* #undef TB_CONFIG_WINDOWS_HAVE__INTERLOCKEDCOMPAREEXCHANGE64_REL */

// bsd functions
#define TB_CONFIG_BSD_HAVE_FLOCK 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

flock() is a BSD-specific function and is not typically available on Solaris. Solaris uses fcntl() for file locking. Enabling this macro might lead to compilation or runtime errors if the code relies on flock(). Please verify if flock() is available in your target Solaris environment or if there's a compatibility layer. If not, this should be undefined.

Suggested change
#define TB_CONFIG_BSD_HAVE_FLOCK 1
/* #undef TB_CONFIG_BSD_HAVE_FLOCK */

Comment on lines +51 to +54
#ifdef TB_CONFIG_OS_SOLARIS
#include <sys/types.h>
#include <signal.h>
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This block is redundant. <signal.h> is already included for Solaris in the preprocessor block at lines 41-44. <sys/types.h> is a very basic header and is likely included by other headers already. If it is strictly necessary, it should be added to the block at lines 41-44 to keep the includes for Solaris grouped together and avoid redundancy. It's best to remove this block.

Comment on lines +21 to +33
platform("solaris")
set_os("solaris")
set_hosts("solaris")
set_archs("i386", "x86_64")

set_formats("static", "lib$(name).a")
set_formats("object", "$(name).o")
set_formats("shared", "lib$(name).so")
set_formats("symbol", "$(name).sym")

set_installdir("/usr/local")

set_toolchains("envs", "gcc", "clang", "yasm", "nasm", "fasm", "cuda", "go", "rust", "gfortran", "zig")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This is a good start for Solaris platform support. For future improvements, you could consider the following:

  • Architectures: Currently, only i386 and x86_64 are listed. Solaris also has significant usage on the SPARC architecture (sparc, sparcv9). Adding these would make the support more complete.
  • Toolchains: The list of toolchains is missing the native Solaris compiler, Oracle Developer Studio (formerly Sun Studio), which uses cc for C and CC for C++. Adding support for it would provide better integration with the native development environment on Solaris.

@waruqi waruqi merged commit 12877b5 into dev Nov 24, 2025
52 of 53 checks passed
@waruqi waruqi deleted the solaris branch November 24, 2025 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant