登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
登录
注册
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
7
Star
0
Fork
28
src-openEuler
/
open-iscsi
代码
Issues
3
Pull Requests
5
Wiki
统计
流水线
服务
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
162
Backport:fix several bugs, support clang build
开启的
云沧:pr
src-openEuler:master
云沧
创建于 2024-09-25 22:36
克隆/下载
HTTPS
SSH
复制
下载 Email Patch
下载 Diff 文件
# PR主要描述信息 * 此PR基于[这个oEEP](https://gitee.com/openeuler/TC/blob/master/oEEP/oEEP-0003%20LLVM%E5%B9%B3%E8%A1%8C%E5%AE%87%E5%AE%99%E8%AE%A1%E5%88%92--%E5%9F%BA%E4%BA%8ELLVM%E6%8A%80%E6%9C%AF%E6%A0%88%E6%9E%84%E5%BB%BAoE%E8%BD%AF%E4%BB%B6%E5%8C%85.md),旨在使得该软件包可以同时支持GCC和LLVM构建。 * 不影响原来的构建行为 * 上游PR:https://github.com/open-iscsi/open-iscsi/pull/478 * **问题一:** ```c [ 102s] clang: error: -Wl,-z,relro: 'linker' input unused [-Werror,-Wunused-command-line-argument] [ 102s] clang: error: -Wl,-z,now: 'linker' input unused [-Werror,-Wunused-command-line-argument] [ 102s] clang: error: -lkmod: 'linker' input unused [-Werror,-Wunused-command-line-argument] ``` * **问题成因总结:** spec文件中将链接器(linker)选项多余地传给了编译器 * **修改建议:** 在%if "%toolchain" \=\= "clang"判断控制条件下,将编译器与链接器选项分开,编译器选项给CFLAGS,链接器选项给LDFLAGS,使llvm能够构建,不影响gcc构建。 * **问题二:** ```c [ 93s] In file included from io.c:41: [ 93s] In file included from ./iface.h:23: [ 93s] In file included from ../libopeniscsiusr/libopeniscsiusr/libopeniscsiusr.h:30: [ 93s] ../libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_common.h:75:8: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] [ 93s] 75 | struct __DLL_EXPORT iscsi_session; [ 93s] | ^ [ 93s] ../libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_common.h:64:38: note: expanded from macro '__DLL_EXPORT' [ 93s] 64 | #define __DLL_EXPORT __attribute__ ((visibility ("default"))) [ 93s] | ^ [ 93s] ./initiator.h:198:16: note: previous definition is here [ 93s] 198 | typedef struct iscsi_session { [ 93s] | ^ ``` * **问题成因总结:** clang要求"attribute declaration must precede definition"即带有attribute的声明必须先于定义,在该问题情境中体现为头文件的顺序,\#include "iface.h"要先于\#include "initiator.h" * **修改建议:** 在出现该问题的文件中,将\#include "iface.h"移动到\#include "initiator.h"之前 * **问题三:** ```c [ 89s] In file included from session_info.c:19: [ 89s] ./iscsid_req.h:21:9: error: 'ISCSID_REQ_H_' is used as a header guard here, followed by #define of a different macro [-Werror,-Wheader-guard] [ 89s] 21 | #ifndef ISCSID_REQ_H_ [ 89s] | ^~~~~~~~~~~~~ [ 89s] ./iscsid_req.h:22:9: note: 'ISCSID_REQ_H' is defined here; did you mean 'ISCSID_REQ_H_'? [ 89s] 22 | #define ISCSID_REQ_H [ 89s] | ^~~~~~~~~~~~ [ 89s] | ISCSID_REQ_H_ [ 89s] 1 error generated. ``` * **问题成因总结:** 少了个下划线 * **修改建议:** 回合上游commit:[fix: add usr/iscsid_req.h missinig underline (#431) · hanqingwu/open-iscsi@2989724 (github.com)](https://github.com/hanqingwu/open-iscsi/commit/29897249ab77739f6b233677d761e24705b33f6a) * **问题四:** ```c [ 88s] mgmt_ipc.c:511:19: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] [ 88s] 511 | qtask->allocated = 1; [ 88s] | ^ ~ [ 88s] 1 error generated. ``` * **问题成因总结:** 这个错误是由于在代码中存在一个隐式截断问题。试图将一个 `int` 类型的值(这里是 `1`)赋给一个一位宽的位域(allocated),但由于位域的宽度为1位,这样的操作可能会导致值从`1`被截断为`-1` * **修改建议:** 修改`int allocated : 1`为`unsigned int allocated : 1` * **问题五:** ```c [ 93s] discovery.c:698:6: error: variable 'num_targets' set but not used [-Werror,-Wunused-but-set-variable] [ 93s] 698 | int num_targets = 0; [ 93s] | ^ [ 93s] 1 warning and 1 error generated. ``` * **问题成因总结:** num_targets变量在定义之后,只有自增操作,并没有被具体使用 * **修改建议:** 可以将这三处出现的地方(一处定义,两处自增)删除的 * **问题六:** ```c [ 95s] In file included from discoveryd.c:31: [ 95s] ./iface.h:61:29: error: declaration of 'struct iovec' will not be visible outside of this function [-Werror,-Wvisibility] [ 95s] 61 | int iface_all, struct iovec *iovs); [ 95s] | ^ [ 95s] 1 error generated. ``` * **问题成因总结:** struct iovec的定义在系统库 <sys/uio.h>中,而iface.h中既没有对struct iovec的定义,也没有包含该头文件 * **修改建议:** 在iface.h头文件中#include<sys/uio.h>
此 Pull Request 可以被系统自动合并 ,目标分支为保护分支,您没有合并权限
怎样手动合并此 Pull Request
git checkout master
git pull https://gitee.com/yuncang123/open-iscsi.git pr
git push origin master
评论
17
提交
1
文件
6
检查
代码问题
0
批量操作
展开设置
折叠设置
审查
Code Owner
审查人员
liuzhiqiang
liuzhiqiang26
linfeilong835
volcanodragon
louhongxiang
louhongxiang
swf504
swf504
刘波
liubo254
kouwq
kouwq
未设置
最少人数
0
测试
liuzhiqiang
liuzhiqiang26
linfeilong835
volcanodragon
louhongxiang
louhongxiang
swf504
swf504
刘波
liubo254
kouwq
kouwq
未设置
最少人数
0
优先级
不指定
严重
主要
次要
不重要
标签
openeuler-cla/yes
ci_successful
sig/Storage
关联 Issue
未关联
Pull Request 合并后将关闭上述关联 Issue
里程碑
未关联里程碑
合并选项
合并后删除提交分支
提交分支为默认分支,无法删除
合并后关闭提到的 Issue
接受 Pull Request 时使用扁平化(Squash)合并
勾选此选项后,将建议使用 Squash Merge 方式合并以精简提交历史记录
参与者
(3)
1
https://gitee.com/src-openeuler/open-iscsi.git
git@gitee.com:src-openeuler/open-iscsi.git
src-openeuler
open-iscsi
open-iscsi
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册