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

improve mingw implib #1675

Merged
merged 4 commits into from
Sep 16, 2021
Merged

improve mingw implib #1675

merged 4 commits into from
Sep 16, 2021

Conversation

waruqi
Copy link
Member

@waruqi waruqi commented Sep 15, 2021

@SirLynix
Copy link
Member

libsdl installation fails on this branch:

C:\Program Files\xmake\winenv\bin\7z x -y SDL2-devel-2.0.16-VC.zip -osource.tmp

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 2238015 bytes (2186 KiB)

Extracting archive: SDL2-devel-2.0.16-VC.zip
--
Path = SDL2-devel-2.0.16-VC.zip
Type = zip
Physical Size = 2238015

Everything is Ok

Folders: 6
Files: 129
Size:       7544943
Compressed: 2238015
finding libsdl from xmake ..
checking for xmake::libsdl ... libsdl 2.0.16
{
  license = "zlib",
  sysincludedirs = {
    "C:\Users\lynix\AppData\Local\.xmake\packages\l\libsdl\2.0.16\5199f17d84a742b4be3931c788c54397\include",
    "C:\Users\lynix\AppData\Local\.xmake\packages\l\libsdl\2.0.16\5199f17d84a742b4be3931c788c54397\include\SDL2"
  },
  syslinks = {
    "gdi32",
    "user32",
    "winmm",
    "shell32"
  },
  shared = true
}

patching C:\Users\lynix\AppData\Local\.xmake\packages\l\libsdl\2.0.16\5199f17d84a742b4be3931c788c54397\lib\pkgconfig\libsdl.pc ..
> C:\mingw64\bin\x86_64-w64-mingw32-gcc -c -m64 -DSDL_MAIN_HANDLED -isystem C:\Users\lynix\AppData\Local\.xmake\packages\l\libsdl\2.0.16\5199f17d84a742b4be3931c788c54397\include -isystem C:\Users\lynix\AppData\L
ocal\.xmake\packages\l\libsdl\2.0.16\5199f17d84a742b4be3931c788c54397\include\SDL2 -o C:\Users\lynix\AppData\Local\Temp\.xmake\210916\_7CBECC955F3540208F715583E9362930.o C:\Users\lynix\AppData\Local\Temp\.xmake\
210916\_38E6FC33E76540208986B365CEB01120.c
> C:\mingw64\bin\x86_64-w64-mingw32-g++ -o C:\Users\lynix\AppData\Local\Temp\.xmake\210916\_A982EE35CF6640208F3C29258A01DB90.b C:\Users\lynix\AppData\Local\Temp\.xmake\210916\_7CBECC955F3540208F715583E9362930.o
-m64 -lgdi32 -luser32 -lwinmm -lshell32
> checking for c includes(SDL2/SDL.h)
> checking for c funcs(SDL_Init)
> checking for c links(gdi32, user32, winmm, shell32)
> checking for c snippet(has_cfuncs)
checkinfo: ...gramdir\core\sandbox\modules\import\core\tool\linker.lua:75: @programdir\core\sandbox\modules\os.lua:264: c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.e
xe: C:\Users\lynix\AppData\Local\Temp\.xmake\210916\_7CBECC955F3540208F715583E9362930.o:_38E6FC33E76540208986B365CEB01120.c:(.rdata$.refptr.SDL_Init[.refptr.SDL_Init]+0x0): undefined reference to `SDL_Init'
collect2.exe: error: ld returned 1 exit status

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:829]: in function 'raise'
    [@programdir\core\sandbox\modules\os.lua:264]: in function 'runv'
    [@programdir\modules\core\tools\gcc.lua:357]:
    [C]: in function 'link'
    [...gramdir\core\sandbox\modules\import\core\tool\linker.lua:73]: in function 'link'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:219]:
    [C]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:121]: in function 'try'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:209]: in function 'has_cfuncs'
    [...make\repositories\xmake-repo\packages\l\libsdl\xmake.lua:148]: in function 'script'
    [...dir\modules\private\action\require\impl\utils\filter.lua:125]: in function 'call'
    [...dir\modules\private\action\require\impl\actions\test.lua:41]: in function 'test'
    [...\modules\private\action\require\impl\actions\install.lua:203]:
    [C]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:121]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:137]: in function 'action_install'
    [...modules\private\action\require\impl\install_packages.lua:364]: in function 'jobfunc'
    [@programdir\modules\private\async\runjobs.lua:208]:
    [C]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:121]: in function 'try'
    [@programdir\modules\private\async\runjobs.lua:201]: in function 'cotask'
    [@programdir\core\base\scheduler.lua:365]:

error: ...make\repositories\xmake-repo\packages\l\libsdl\xmake.lua:148: assertion failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:829]: in function 'raiselevel'
    [@programdir\core\sandbox\modules\utils.lua:183]: in function 'assert'
    [...make\repositories\xmake-repo\packages\l\libsdl\xmake.lua:148]: in function 'script'
    [...dir\modules\private\action\require\impl\utils\filter.lua:125]: in function 'call'
    [...dir\modules\private\action\require\impl\actions\test.lua:41]: in function 'test'
    [...\modules\private\action\require\impl\actions\install.lua:203]:
    [C]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:121]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:137]: in function 'action_install'
    [...modules\private\action\require\impl\install_packages.lua:364]: in function 'jobfunc'
    [@programdir\modules\private\async\runjobs.lua:208]:
    [C]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:121]: in function 'try'
    [@programdir\modules\private\async\runjobs.lua:201]: in function 'cotask'
    [@programdir\core\base\scheduler.lua:365]:

  => install libsdl 2.0.16 .. failed

@waruqi
Copy link
Member Author

waruqi commented Sep 16, 2021

libsdl installation fails on this branch:

You can try it again. I have fixed.

@SirLynix
Copy link
Member

It works fine for me, however shared libraries are generated with the lib prefix, which I'm unsure about, but @ImperatorS79 probably knows better than I do

@ImperatorS79
Copy link
Contributor

Shared and static librairies are generally prefixed by lib on mingw AFAIK (it is the case with MSYS2). Sometimes shared librairies are not prefixed.

The extension is .dll.a for implib and .a for static lib normally.

Please not that gcc linker does not really care about the extension (.lib might work), but .dll.a and .a are the default as far as I understand.

@SirLynix
Copy link
Member

It seems good then 👍

@waruqi
Copy link
Member Author

waruqi commented Sep 16, 2021

does it work now? I am going to merge it.

@SirLynix
Copy link
Member

Yes, it works properly for my projects 👍

@waruqi waruqi merged commit 388ee60 into dev Sep 16, 2021
@waruqi waruqi deleted the mingw branch September 16, 2021 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants