Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix a build problem with clang and --with-opt-dir. #571

Closed
wants to merge 1 commit into from

1 participant

@knu
Collaborator
  • configure.in: Fix a build problem with clang and --with-opt-dir. If ruby is configured with --with-opt-dir=dir when using clang as compiler, a warning clang: warning: argument unused during compilation: '-I dir' is emitted almost every time clang compiles a file. Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes any output from the compiler as fatal error, and the check thus fails due to the warning. This is an attempt to fix the problem by adding a flag -Qunused-arguments to CFLAGS locally in the function to suppress the warning.
@knu knu Fix a build problem with clang and --with-opt-dir.
* configure.in: Fix a build problem with clang and --with-opt-dir.
  If ruby is configured with --with-opt-dir=dir when using clang
  as compiler, a warning `clang: warning: argument unused during
  compilation: '-I dir'` is emitted almost every time clang
  compiles a file.  Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes
  any output from the compiler as fatal error, and the check thus
  fails due to the warning.  This is an attempt to fix the problem
  by adding a flag -Qunused-arguments to CFLAGS locally in the
  function to suppress the warning.
d39779c
@knu knu closed this pull request from a commit
@knu knu Fix a build problem with clang and --with-opt-dir.
* configure.in: Fix a build problem with clang and --with-opt-dir.
  If ruby is configured with --with-opt-dir=dir when using clang
  as compiler, a warning `clang: warning: argument unused during
  compilation: '-I dir'` is emitted almost every time clang
  compiles a file.  Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes
  any output from the compiler as fatal error, and the check thus
  fails due to the warning.  This is an attempt to fix the problem
  by adding a flag -Qunused-arguments to CFLAGS locally in the
  function to suppress the warning. [ruby-dev:48062] [Bug #9658]
  [Fixes GH-571] #571

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
cc4271c
@knu knu closed this in cc4271c
@mmasaki mmasaki referenced this pull request from a commit in mmasaki/ruby
@knu knu Fix a build problem with clang and --with-opt-dir.
* configure.in: Fix a build problem with clang and --with-opt-dir.
  If ruby is configured with --with-opt-dir=dir when using clang
  as compiler, a warning `clang: warning: argument unused during
  compilation: '-I dir'` is emitted almost every time clang
  compiles a file.  Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes
  any output from the compiler as fatal error, and the check thus
  fails due to the warning.  This is an attempt to fix the problem
  by adding a flag -Qunused-arguments to CFLAGS locally in the
  function to suppress the warning. [ruby-dev:48062] [Bug #9658]
  [Fixes GH-571] ruby#571

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2e9562a
@evanphx evanphx referenced this pull request from a commit
@nagachika nagachika merge revision(s) r45378: [Backport #9658] [Backport #9866]
	* configure.in: Fix a build problem with clang and --with-opt-dir.
	  If ruby is configured with --with-opt-dir=dir when using clang
	  as compiler, a warning `clang: warning: argument unused during
	  compilation: '-I dir'` is emitted almost every time clang
	  compiles a file.  Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes
	  any output from the compiler as fatal error, and the check thus
	  fails due to the warning.  This is an attempt to fix the problem
	  by adding a flag -Qunused-arguments to CFLAGS locally in the
	  function to suppress the warning. [ruby-dev:48062] [Bug #9658]
	  [Fixes GH-571] #571


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
c4830ed
@hsbt hsbt referenced this pull request from a commit
@nagachika nagachika merge revision(s) r45378: [Backport #9658] [Backport #9866]
	* configure.in: Fix a build problem with clang and --with-opt-dir.
	  If ruby is configured with --with-opt-dir=dir when using clang
	  as compiler, a warning `clang: warning: argument unused during
	  compilation: '-I dir'` is emitted almost every time clang
	  compiles a file.  Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes
	  any output from the compiler as fatal error, and the check thus
	  fails due to the warning.  This is an attempt to fix the problem
	  by adding a flag -Qunused-arguments to CFLAGS locally in the
	  function to suppress the warning. [ruby-dev:48062] [Bug #9658]
	  [Fixes GH-571] #571


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
089d93c
@gam3 gam3 referenced this pull request from a commit
@knu knu Fix a build problem with clang and --with-opt-dir.
* configure.in: Fix a build problem with clang and --with-opt-dir.
  If ruby is configured with --with-opt-dir=dir when using clang
  as compiler, a warning `clang: warning: argument unused during
  compilation: '-I dir'` is emitted almost every time clang
  compiles a file.  Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes
  any output from the compiler as fatal error, and the check thus
  fails due to the warning.  This is an attempt to fix the problem
  by adding a flag -Qunused-arguments to CFLAGS locally in the
  function to suppress the warning. [ruby-dev:48062] [Bug #9658]
  [Fixes GH-571] #571

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
b435ce0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 20, 2014
  1. @knu

    Fix a build problem with clang and --with-opt-dir.

    knu authored
    * configure.in: Fix a build problem with clang and --with-opt-dir.
      If ruby is configured with --with-opt-dir=dir when using clang
      as compiler, a warning `clang: warning: argument unused during
      compilation: '-I dir'` is emitted almost every time clang
      compiles a file.  Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes
      any output from the compiler as fatal error, and the check thus
      fails due to the warning.  This is an attempt to fix the problem
      by adding a flag -Qunused-arguments to CFLAGS locally in the
      function to suppress the warning.
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 1 deletion.
  1. +12 −0 ChangeLog
  2. +4 −1 configure.in
View
12 ChangeLog
@@ -1,3 +1,15 @@
+Thu Mar 20 23:41:45 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * configure.in: Fix a build problem with clang and --with-opt-dir.
+ If ruby is configured with --with-opt-dir=dir when using clang
+ as compiler, a warning `clang: warning: argument unused during
+ compilation: '-I dir'` is emitted almost every time clang
+ compiles a file. Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes
+ any output from the compiler as fatal error, and the check thus
+ fails due to the warning. This is an attempt to fix the problem
+ by adding a flag -Qunused-arguments to CFLAGS locally in the
+ function to suppress the warning.
+
Thu Mar 20 16:53:07 2014 Koichi Sasada <ko1@atdot.net>
* gc.c (objspace_malloc_increase): should not invoke
View
5 configure.in
@@ -779,6 +779,8 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
rb_cv_warnflags="$warnflags"
warnflags=
fi
+RUBY_TRY_CFLAGS(-Qunused-arguments, [RUBY_APPEND_OPTIONS(rb_cv_wsuppress_flags, -Qunused-arguments)])
+
if test "$GCC" = yes; then
# -D_FORTIFY_SOURCE
# When defined _FORTIFY_SOURCE, glibc enables some additional sanity
@@ -1302,7 +1304,8 @@ AC_DEFINE_UNQUOTED(PACKED_STRUCT_UNALIGNED(x), $packed_struct_unaligned)
AC_DEFUN([RUBY_CHECK_PRINTF_PREFIX], [
AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[
[rb_cv_pri_prefix_]AS_TR_SH($1)=[NONE]
- RUBY_WERROR_FLAG(for pri in $2; do
+ RUBY_WERROR_FLAG(RUBY_APPEND_OPTIONS(CFLAGS, $rb_cv_wsuppress_flags)
+ for pri in $2; do
AC_TRY_COMPILE(
[@%:@include <stdio.h>
@%:@include <stddef.h>
Something went wrong with that request. Please try again.