已开启
fix: use dyld_fallback_library_path #520
余敲鱼创建于 5月22日
fix: use dyld_fallback_library_path #520
已开启
共 7 个文件变更+10-10
| @@ -922,7 +922,7 @@ This feature is temporarily unsupported when compiling for macOS targets. | |||
| 922 | 922 | ||
| 923 | ### `--set-runtime-rpath` | 923 | ### `--set-runtime-rpath` |
| 924 | 924 | ||
| 925 | -Writes the absolute path of the Cangjie runtime library directory into the RPATH/RUNPATH section of the binary. When this option is used, there is no need to set the Cangjie runtime library directory using `LD_LIBRARY_PATH` (for Linux platforms) or `DYLD_LIBRARY_PATH` (for macOS platforms) when running the Cangjie program in the build environment. | 925 | +Writes the absolute path of the Cangjie runtime library directory into the RPATH/RUNPATH section of the binary. When this option is used, there is no need to set the Cangjie runtime library directory using `LD_LIBRARY_PATH` (for Linux platforms) or `DYLD_FALLBACK_LIBRARY_PATH` (for macOS platforms) when running the Cangjie program in the build environment. |
| 926 | 926 | ||
| 927 | This feature is not supported when compiling for Windows targets. | 927 | This feature is not supported when compiling for Windows targets. |
| 928 | 928 | ||
| @@ -43,7 +43,7 @@ This section describes the deployment of the Cangjie runtime. | |||
| 43 | 3. Execute the following command in the runtime environment to complete the runtime deployment (replace `${CANGJIE_HOME}` with the path to the `cangjie` directory and `${hw_arch}` with the corresponding hardware architecture): | 43 | 3. Execute the following command in the runtime environment to complete the runtime deployment (replace `${CANGJIE_HOME}` with the path to the `cangjie` directory and `${hw_arch}` with the corresponding hardware architecture): |
| 44 | 44 | ||
| 45 | ```bash | 45 | ```bash |
| 46 | - export DYLD_LIBRARY_PATH=${CANGJIE_HOME}/runtime/lib/darwin_${hw_arch}_cjnative:${DYLD_LIBRARY_PATH} | 46 | + export DYLD_FALLBACK_LIBRARY_PATH=${CANGJIE_HOME}/runtime/lib/darwin_${hw_arch}_cjnative:${DYLD_FALLBACK_LIBRARY_PATH} |
| 47 | ``` | 47 | ``` |
| 48 | 48 | ||
| 49 | ## Windows | 49 | ## Windows |
| @@ -275,10 +275,10 @@ Taking Cangjie calling ObjC as an example, the overall development process is de | |||
| 275 | brew install llvm@15 | 275 | brew install llvm@15 |
| 276 | ``` | 276 | ``` |
| 277 | 277 | ||
| 278 | -3. Add the `llvm@15/lib/` subdirectory to the `DYLD_LIBRARY_PATH` environment variable. | 278 | +3. Add the `llvm@15/lib/` subdirectory to the `DYLD_FALLBACK_LIBRARY_PATH` environment variable. |
| 279 | 279 | ||
| 280 | ```bash | 280 | ```bash |
| 281 | - export DYLD_LIBRARY_PATH=/opt/homebrew/opt/llvm@15/lib:$DYLD_LIBRARY_PATH | 281 | + export DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/opt/llvm@15/lib:$DYLD_FALLBACK_LIBRARY_PATH |
| 282 | ``` | 282 | ``` |
| 283 | 283 | ||
| 284 | 4. Verify successful installation: Execute the following command. If the ObjCInteropGen usage instructions appear, the installation was successful. | 284 | 4. Verify successful installation: Execute the following command. If the ObjCInteropGen usage instructions appear, the installation was successful. |
| @@ -1510,11 +1510,11 @@ file from the Cangjie open source repository:** | |||
| 1510 | brew install llvm@16 | 1510 | brew install llvm@16 |
| 1511 | ``` | 1511 | ``` |
| 1512 | 1512 | ||
| 1513 | -2. Add the `llvm@16/lib/` subdirectory to the `DYLD_LIBRARY_PATH` | 1513 | +2. Add the `llvm@16/lib/` subdirectory to the `DYLD_FALLBACK_LIBRARY_PATH` |
| 1514 | environment variable: | 1514 | environment variable: |
| 1515 | 1515 | ||
| 1516 | ```bash | 1516 | ```bash |
| 1517 | - export DYLD_LIBRARY_PATH=/opt/homebrew/opt/llvm@16/lib:$DYLD_LIBRARY_PATH | 1517 | + export DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/opt/llvm@16/lib:$DYLD_FALLBACK_LIBRARY_PATH |
| 1518 | ``` | 1518 | ``` |
| 1519 | 1519 | ||
| 1520 | 3. Run the `envsetup.sh` script from the Cangjie SDK. | 1520 | 3. Run the `envsetup.sh` script from the Cangjie SDK. |
| @@ -909,7 +909,7 @@ cjc --target=arch-os-env --sysroot /usr/sdk/arch-os-env hello.cj -o hello | |||
| 909 | 909 | ||
| 910 | ### `--set-runtime-rpath` | 910 | ### `--set-runtime-rpath` |
| 911 | 911 | ||
| 912 | -将仓颉运行时库所在目录的绝对路径写入到二进制的 RPATH/RUNPATH 段中,使用该选项后在构建所在环境中运行该仓颉程序时无需再使用 LD_LIBRARY_PATH (适用于 Linux 平台) 或 DYLD_LIBRARY_PATH (适用于 macOS 平台) 设置仓颉运行时库目录。 | 912 | +将仓颉运行时库所在目录的绝对路径写入到二进制的 RPATH/RUNPATH 段中,使用该选项后在构建所在环境中运行该仓颉程序时无需再使用 LD_LIBRARY_PATH (适用于 Linux 平台) 或 DYLD_FALLBACK_LIBRARY_PATH (适用于 macOS 平台) 设置仓颉运行时库目录。 |
| 913 | 913 | ||
| 914 | 编译 Windows 目标时不支持使用该功能。 | 914 | 编译 Windows 目标时不支持使用该功能。 |
| 915 | 915 | ||
| @@ -43,7 +43,7 @@ | |||
| 43 | 3. 请在运行环境执行如下命令完成 `runtime` 的部署(其中 `${CANGJIE_HOME}` 请修改为 `cangjie` 目录所在的路径,`${hw_arch}` 请修改为对应的硬件架构): | 43 | 3. 请在运行环境执行如下命令完成 `runtime` 的部署(其中 `${CANGJIE_HOME}` 请修改为 `cangjie` 目录所在的路径,`${hw_arch}` 请修改为对应的硬件架构): |
| 44 | 44 | ||
| 45 | ```bash | 45 | ```bash |
| 46 | - export DYLD_LIBRARY_PATH=${CANGJIE_HOME}/runtime/lib/darwin_${hw_arch}_cjnative:${DYLD_LIBRARY_PATH} | 46 | + export DYLD_FALLBACK_LIBRARY_PATH=${CANGJIE_HOME}/runtime/lib/darwin_${hw_arch}_cjnative:${DYLD_FALLBACK_LIBRARY_PATH} |
| 47 | ``` | 47 | ``` |
| 48 | 48 | ||
| 49 | ## Windows | 49 | ## Windows |
| @@ -278,10 +278,10 @@ cjc 自动生成胶水代码需要获取在跨编程语言调用中涉及的 Obj | |||
| 278 | brew install llvm@16 | 278 | brew install llvm@16 |
| 279 | ``` | 279 | ``` |
| 280 | 280 | ||
| 281 | -3. 将 `llvm@16/lib/` 子目录添加到 `DYLD_LIBRARY_PATH` 环境变量中。 | 281 | +3. 将 `llvm@16/lib/` 子目录添加到 `DYLD_FALLBACK_LIBRARY_PATH` 环境变量中。 |
| 282 | 282 | ||
| 283 | ```bash | 283 | ```bash |
| 284 | - export DYLD_LIBRARY_PATH=/opt/homebrew/opt/llvm@16/lib:$DYLD_LIBRARY_PATH | 284 | + export DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/opt/llvm@16/lib:$DYLD_FALLBACK_LIBRARY_PATH |
| 285 | ``` | 285 | ``` |
| 286 | 286 | ||
| 287 | 4. 检测是否安装成功:执行如下命令,如果出现 ObjCInteropGen 使用说明,则证明安装成功。 | 287 | 4. 检测是否安装成功:执行如下命令,如果出现 ObjCInteropGen 使用说明,则证明安装成功。 |