@@ -102,16 +102,6 @@ def self.build_env_vars
102
102
ldflags = GoGem ::Util . generate_ldflags
103
103
cflags = generate_cflags
104
104
105
- # FIXME: Workaround for Ubuntu (GitHub Actions)
106
- if RUBY_PLATFORM =~ /linux/i
107
- cflags . gsub! ( "-Wno-self-assign" , "" )
108
- cflags . gsub! ( "-Wno-parentheses-equality" , "" )
109
- cflags . gsub! ( "-Wno-constant-logical-operand" , "" )
110
- cflags . gsub! ( "-Wsuggest-attribute=format" , "" )
111
- cflags . gsub! ( "-Wold-style-definition" , "" )
112
- cflags . gsub! ( "-Wsuggest-attribute=noreturn" , "" )
113
- end
114
-
115
105
ld_library_path = RbConfig ::CONFIG [ "libdir" ] . to_s
116
106
117
107
{
@@ -130,11 +120,27 @@ def self.generate_goflags
130
120
131
121
# @return [String]
132
122
def self . generate_cflags
133
- [
134
- RbConfig ::CONFIG [ "CFLAGS" ] ,
135
- "-I#{ RbConfig ::CONFIG [ "rubyarchhdrdir" ] } " ,
136
- "-I#{ RbConfig ::CONFIG [ "rubyhdrdir" ] } " ,
137
- ] . join ( " " )
123
+ cflags =
124
+ [
125
+ RbConfig ::CONFIG [ "CFLAGS" ] ,
126
+ "-I#{ RbConfig ::CONFIG [ "rubyarchhdrdir" ] } " ,
127
+ "-I#{ RbConfig ::CONFIG [ "rubyhdrdir" ] } " ,
128
+ ] . join ( " " )
129
+
130
+ # FIXME: Workaround for Ubuntu (GitHub Actions)
131
+ if RUBY_PLATFORM =~ /linux/i
132
+ cflags . gsub! ( "-Wno-self-assign" , "" )
133
+ cflags . gsub! ( "-Wno-parentheses-equality" , "" )
134
+ cflags . gsub! ( "-Wno-constant-logical-operand" , "" )
135
+ cflags . gsub! ( "-Wsuggest-attribute=format" , "" )
136
+ cflags . gsub! ( "-Wold-style-definition" , "" )
137
+ cflags . gsub! ( "-Wsuggest-attribute=noreturn" , "" )
138
+ end
139
+
140
+ # FIXME: Workaround for Alpine
141
+ cflags . gsub! ( "-Wpointer-arith" , "" ) if RUBY_PLATFORM =~ /linux-musl/i
142
+
143
+ cflags
138
144
end
139
145
private_class_method :generate_cflags
140
146
0 commit comments