Page MenuHomePhabricator

autotools: evil: add needed -lmsvcr100 library flag for _create/_free_locale()
ClosedPublic

Authored by stefan_schmidt on Dec 7 2018, 3:18 AM.

Details

Summary

Since commit 33b8e5157a25b73a0729055ecd22b17e97781e11 we need these two
new symbols on our windows cross build. At least on my mingw system they
are not showing up by default and I need to ensure we are linking
against msvcr100 to get them or I get undefined references during
linking.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
stefan_schmidt created this revision.Dec 7 2018, 3:18 AM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

stefan_schmidt requested review of this revision.Dec 7 2018, 3:18 AM
bu5hm4n accepted this revision.Dec 7 2018, 3:19 AM
This revision is now accepted and ready to land.Dec 7 2018, 3:19 AM
This revision was automatically updated to reflect the committed changes.
vtorri added a comment.Dec 7 2018, 3:47 AM

msvcr100.a is provided by mingw64, but are we sure that the DLL is installed ? If not, the application will fail with function not defined. That can be a problem

I think that we should run a test with AC_RUN_IFELSE (which can be problematic when cross-compiling...).

or we can find another way than _create_locale().

vtorri added a comment.Dec 7 2018, 3:50 AM

btw why linking in evil ?? the symbols are in eina...

vtorri reopened this revision.Dec 7 2018, 5:35 AM

we need to think of better ways

maybe dlopen msvcrt.dll and check the symbol there
if not dlopen mscvr100.dll and check symbol
if not just use strtod

This revision is now accepted and ready to land.Dec 7 2018, 5:35 AM
vtorri added a comment.Dec 7 2018, 5:49 AM

someting like that :

typedef _locale_t (*_create_locale_t)(int category, const char *locale);
HMODULE module = NULL;
_create_locale_t m_create_locale;
char *endptr;
char *str1  = "1.2";
double d;
_locale_t lt;

module=LoadLibrary("msvcr100.dll");
if (module)
  {
    m_create_locale = (_create_locale_t)GetProcAddress(module, "_create_locale");
    if (m_create_locale)
      {
        lt = m_create_locale(LC_NUMERIC, "C");
        d = _strtod_l(str1, &endptr, lt);
        printf(" ** %f\n", d);
      }
    FreeLibrary(module);
  }
vtorri closed this revision.Feb 28 2019, 12:22 PM

resolved in D7926