Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fail of base/iconv.cc, FreeBSD #27

Closed
GoogleCodeExporter opened this issue Apr 22, 2015 · 8 comments
Closed

build fail of base/iconv.cc, FreeBSD #27

GoogleCodeExporter opened this issue Apr 22, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

version: mozc-0.13.464.102
target file: base/iconv.cc
category: build fail
OS: FreeBSD 9-CURRENT / 8.1-RELEASE
CC: gcc 4.2.1 (FreeBSD default compiler)


base/iconv.cc build fails on FreeBSD because of follow line:

     if (iconv(ic, reinterpret_cast<char **>(&ibuf), &ilen, &obuf, &olen)

follow line is acceptable.

     if (iconv(ic, (const char **)(&ibuf), &ilen, &obuf, &olen)

Please change that line or fix it in another way.

Original issue reported on code.google.com by [email protected] on 20 Sep 2010 at 2:58

@GoogleCodeExporter
Copy link
Author

Sorry I don't get your point.  What is the exact error message?   If the input 
type is 'char **' and the prototype for the iconv() is 'const char **', the 
compiler won't raise any errors, I think.  Am I missing something?

In addition, this change also breaks other platform builds because the second 
parameter for iconv is 'char **' but your suggestion passes 'const char **'.  

Original comment by [email protected] on 28 Sep 2010 at 6:43

@GoogleCodeExporter
Copy link
Author

build error message as follow:

--------------------------------------------
base/iconv.cc: In function 'void<unnamed>::IconvHelper(void*, const 
std::string&, std::string*)':
base/iconv.cc:55: error: invalid conversion from 'char**' to 'const char**'
base/iconv.cc:55: error:   initializing argument 2 of 'size_t libiconv(void*, 
const char**, size_t*, char**, size_t*)'
gmake: *** [out_linux/Debug/obj.target/base/base/iconv.o] Error 1
gmake: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "build_mozc.py", line 820, in <module>
    main()
  File "build_mozc.py", line 808, in main
    BuildToolsMain(original_directory_name)
  File "build_mozc.py", line 772, in BuildToolsMain
    BuildMain(original_directory_name)
  File "build_mozc.py", line 751, in BuildMain
    BuildOnLinux(options, targets)
  File "build_mozc.py", line 658, in BuildOnLinux
    RunOrDie([make_command] + build_args + target_names)
  File "build_mozc.py", line 497, in RunOrDie
    '==========']))
__main__.RunOrDieError: 
==========
 ERROR: gmake -j4 BUILDTYPE=Debug primitive_tools
==========
--------------------------------------------


gcc version is as follow:
--------------------------------------------
% uname -a
FreeBSD parancell.ongs.co.jp 9.0-CURRENT FreeBSD 9.0-CURRENT #3 r212885: Mon 
Sep 20 10:16:55 JST 2010     
[email protected]:/usr/obj/usr/src/sys/PARANCELL  amd64
% gcc -v
Using built-in specs.
Target: amd64-undermydesk-freebsd
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070719  [FreeBSD]
% 
--------------------------------------------

Do you want any more logs or information to investigate this issue?

Original comment by [email protected] on 28 Sep 2010 at 7:33

@GoogleCodeExporter
Copy link
Author

Ah, got it.  So what should we do for this?
As you know, just adding const here will break other platforms.  We can't 
accept such way.

In addition, we don't want to add something like:
#ifdef OS_FREEBSD
iconv(...)
#else
iconv(...)
#endif
because it introduces complications all over the codebase.  That is not a good 
idea.

Original comment by [email protected] on 30 Sep 2010 at 5:14

@GoogleCodeExporter
Copy link
Author

Alrighty, I got your intention. Please close this issue.

I'll continue to solve this issue by a patch within Ports Collection forever :) 
 No problem, don,t mind.

Thank you for your response!

Original comment by [email protected] on 30 Sep 2010 at 6:39

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 1 Apr 2012 at 2:16

  • Added labels: OpSys-FreeBSD

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 14 Feb 2013 at 9:17

  • Changed state: Done

@yukawa
Copy link
Collaborator

yukawa commented May 4, 2015

Just FYI, this is indeed an issue in FreeBSD side. See FreeBSD PR 199099, which was recently fixed.

@yukawa
Copy link
Collaborator

yukawa commented Nov 14, 2015

Reopening as this can be fixed in conjunction with #252.

@yukawa yukawa reopened this Nov 14, 2015
@yukawa yukawa closed this as completed in 766685b Nov 15, 2015
yukawa added a commit that referenced this issue Jul 24, 2016
This is a follow up CL to 766685b,
which got rid of the dependency on iconv.

Even though we do not have any plan to use mozc::EncodingUtil in Android
build, in theory this class is compatible with Android.  Hence having
OS_ANDROID does not make sense anymore.

BUG=#27,#252
TEST=
REF_BUG=
REF_CL=107354157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants