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

ICU 55 and 57 on Gentoo Linux say: 'ucol_setVariableTop' is deprecated #5914

Closed
ghost opened this issue May 23, 2016 · 7 comments · Fixed by dotnet/coreclr#5309
Closed

ICU 55 and 57 on Gentoo Linux say: 'ucol_setVariableTop' is deprecated #5914

ghost opened this issue May 23, 2016 · 7 comments · Fixed by dotnet/coreclr#5309

Comments

@ghost
Copy link

ghost commented May 23, 2016

@ellismg,

I setup Gentoo LXC container on Ubuntu. The step-by-step guide to setup Gentoo and repro this issue (from scratch to start building CoreCLR) is documented in this gist (updated this guide with additional steps to build CoreFX native).

Failure Message:

[  3%] Building CXX object src/corefx/System.Globalization.Native/CMakeFiles/System.Globalization.Native.dir/localeNumberData.cpp.o
/root/coreclr/src/corefx/System.Globalization.Native/collation.cpp:282:9: error: 
      'ucol_setVariableTop' is deprecated [-Werror,-Wdeprecated-declarations]
        ucol_setVariableTop(pClonedCollator, ignoreSymbolsVariableTop, 1, pErr);
        ^
/usr/include/unicode/ucol.h:1254:1: note: 'ucol_setVariableTop' has been
      explicitly marked deprecated here
ucol_setVariableTop(UCollator *coll, 
^
1 error generated.
src/corefx/System.Globalization.Native/CMakeFiles/System.Globalization.Native.dir/build.make:110: recipe for target 'src/corefx/System.Globalization.Native/CMakeFiles/System.Globalization.Native.dir/collation.cpp.o' failed
make[2]: *** [src/corefx/System.Globalization.Native/CMakeFiles/System.Globalization.Native.dir/collation.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Official documentation suggests the same thing:
http://icu-project.org/apiref/icu4c/ucol_8h.html#a0e9c28a8b8b88890722daca111207688

Deprecated:
ICU 53 Call ucol_setMaxVariable() instead.

(ucol_setMaxVariable() is stable since ICU 53)

My understand is the decision was made based on this proposal: https://sourceforge.net/p/icu/mailman/message/29538820/.

@adityamandaleeka
Copy link
Member

adityamandaleeka commented May 23, 2016

@jasonwilliams200OK

I just looked at the place where we're calling ucol_setVariableTop and it looks like we only do it if the symbol ucol_setMaxVariable doesn't exist. You can find the definition of HAVE_SET_MAX_VARIABLE in src\corefx\System.Globalization.Native\configure.cmake.

If that symbol does exist and we're still calling ucol_setVariableTop, it's possible there's a problem with how we're setting HAVE_SET_MAX_VARIABLE in the cmake file.

@ghost
Copy link

ghost commented May 24, 2016

@adityamandaleeka, seems like that's the case. cmake_symbol_exists detection for ucol_setMaxVariable is failing. From CMakeError.log:

/root/coreclr/bin/obj/Linux.x64.Debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c:(.text+0x19): undefined reference to `ucol_setMaxVariable'

I tried using cmake_function_exists (which uses the built in -DCHECK_FUNCTION_EXISTS), but got the exact same error. It seems like it is not linking to libicu (even though I had set(CMAKE_REQUIRED_LIBRARIES ${ICUUC}) before it):

/usr/bin/clang -Wall -std=c11 -DCHECK_FUNCTION_EXISTS=ucol_setMaxVariable -I/usr/local/opt/icu4c/include -o CMakeFiles/cmTC_da2df.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c

@sergiy-k
Copy link
Contributor

/cc @ellismg

@ghost
Copy link

ghost commented May 29, 2016

With this temporary 1-liner patch:

--- a/src/corefx/System.Globalization.Native/config.h.in
+++ b/src/corefx/System.Globalization.Native/config.h.in
@@ -1,4 +1,4 @@
 #pragma once

 #cmakedefine01 HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS
-#cmakedefine01 HAVE_SET_MAX_VARIABLE
+#define HAVE_SET_MAX_VARIABLE 1

I have successfully built CoreCLR current master (5c00a5f) on Gentoo 4.2.0-27-generic.

janvorli referenced this issue in dotnet/coreclr May 30, 2016
The issue was the symbol is exported by the ICU lib. Including headers
was not enough. The linker requires the libraries to succeed.

With this fix, CoreCLR successfully builds on Gentoo Linux 100%.
Tested with LXC gentoo container on Ubuntu machine.

Steps to configure and build:
https://gist.github.com/jasonwilliams200OK/1a2e2c0e904ffa95faf6333fcd88d9b8

Fix #5160
@Const-me
Copy link

Might have been fixed for Gentoo, but FreeBSD 11 has the same problem. Trying to build the latest master branch of CoreCLR with LLVM 3.7.
@ghost thanks for your temporary patch, it worked OK for me.

@janvorli
Copy link
Member

@Const-me my guess is that we are probably missing a library in the CMAKE_REQUIRED_LIBRARIES for the HAVE_SET_MAX_VARIABLE detection. Could you please share the whole CMakeError.log?

@Const-me
Copy link

Sure.

Here's the logs from both 11 and 12.
cmake-logs.zip

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 30, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants