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

Missing symbols in libuuid.a #5616

Closed
joankaradimov opened this issue Jul 17, 2019 · 30 comments
Closed

Missing symbols in libuuid.a #5616

joankaradimov opened this issue Jul 17, 2019 · 30 comments

Comments

@joankaradimov
Copy link
Contributor

I'm trying to get a python-pywin32 build running in MinGW. Here is some of my progress. However, I encountered some missing symbols in libuuid.a. They are all present in Uuid.Lib shipped with the Microsoft SDK.

Here's the output from ld:

build/temp.mingw-2.7/com/win32com/src/PythonCOM.o:PythonCOM.cpp:(.rdata$.refptr.IID_IContext[.refptr.IID_IContext]+0x0): undefined reference to `IID_IContext'
build/temp.mingw-2.7/com/win32com/src/PythonCOM.o:PythonCOM.cpp:(.rdata$.refptr.IID_IAccessControl[.refptr.IID_IAccessControl]+0x0): undefined reference to `IID_IAccessControl'
build/temp.mingw-2.7/com/win32com/src/Register.o:Register.cpp:(.rdata+0xe38): undefined reference to `IID_IContext'
build/temp.mingw-2.7/com/win32com/src/Register.o:Register.cpp:(.rdata+0xe60): undefined reference to `IID_IEnumContextProps'
build/temp.mingw-2.7/com/win32com/src/Register.o:Register.cpp:(.rdata+0xeb0): undefined reference to `CLSID_DCOMAccessControl'
build/temp.mingw-2.7/com/win32com/src/extensions/PyIContext.o:PyIContext.cpp:(.rdata$.refptr.IID_IEnumContextProps[.refptr.IID_IEnumContextProps]+0x0): undefined reference to `IID_IEnumContextProps'
@ZachBacon
Copy link
Contributor

chances are a patch will need to be submitted to the mingw-w64 git on sf.net. Shouldn't be hard to make a quick patch for use locally

@joankaradimov
Copy link
Contributor Author

Could it be a problem with the msys2 distribution? When I grep the mingw-w64 sources I find each of those symbols. On the other hand it's only in headers and some are extern. I don't know if that's enough for the correct static import library to be generated.

On top of that my understanding of COM is limited. Even less so outside MSVC.

@ZachBacon
Copy link
Contributor

ZachBacon commented Jul 18, 2019

It's not an msys2 issue it's a CRT in mingw. Go to file in mingw-w64-crt/libsrc/uuid.c that's where your changes would go for the new uuid's anyways I can probably make the change, but I'm heading to bed myself.

@joankaradimov
Copy link
Contributor Author

I can probably make the change

It would be great if you can find the time and make it.

How are patches discussed/submitted to mingw-w64? Is it via a mailing list? If I can see an example I could do this myself in the future.

@ZachBacon
Copy link
Contributor

It's submitted via their mailing list.

@ZachBacon
Copy link
Contributor

ZachBacon commented Jul 20, 2019

Got 2 of the UUID's implemented, One of them maybe a little more interesting to implement, but once I get the patches generated I'll send it to the mailing list.

EDIT:

Mind testing these patches against a local mingw-w64 package and see if these work for you? You'll have to build the package from source though.

IID_IContext.patch.txt
IID_IAccessControl.patch.txt

@joankaradimov
Copy link
Contributor Author

It looks great. There's only one error now...

build/temp.mingw-2.7/com/win32com/src/Register.o:Register.cpp:(.rdata+0xeb0): undefined reference to `CLSID_DCOMAccessControl'

@ZachBacon
Copy link
Contributor

Excellent, I'll work on that today and I'll see about getting that in the mailing list.

@ZachBacon
Copy link
Contributor

A lot of those missing uuid's were actually in objidl.h, so it was a matter of moving them. There was one I had to do a bit of research though and for CSLID_DCOMAccessControl, I'll have to a do a bit of research there too, but it should be easy enough.

@ZachBacon
Copy link
Contributor

This one should fix the CLSID_DCOMAccessControl undefined. If this works, I'll throw it at the mingw-w64 devs in their mailing list, I honestly don't know if they'll accept it, and I'm not sure @Alexpux would accept the patches in the MinGW CRT package either
CLSID_DCOMAccessControl.patch.txt

@Alexpux
Copy link
Member

Alexpux commented Jul 20, 2019

Create pull request for mingw-w64 headers/crt packages and I will review

@ZachBacon
Copy link
Contributor

Alright, as soon as @joankaradimov tests to see if it fixes his pywin32 package. Then I'll be submitting these patches for mingw-64's mailing list and then I'll make the PR for the mingw crt msys package.

@joankaradimov
Copy link
Contributor Author

If this works, I'll throw it at the mingw-w64 devs in their mailing list

The last patch works too. And it got me through that step of the compilation.

Alright, as soon as @joankaradimov tests to see if it fixes his pywin32 package

Well, it doesn't fix the package, but it does fix the compilation of one of the python modules in it :)
I'm already working on the rest.

Create pull request for mingw-w64 headers/crt packages and I will review

@Alexpux: I don't know if that's necessary. I'm not in a hurry. There are quite a few other issues to fix first in pywin32. We can wait and see if this will be merged in master. Right now I have a package that works locally and that's good enough for now.

@ZachBacon
Copy link
Contributor

@joankaradimov I'll be doing the PR for the packages, because it'll be nice to have that all situated as long as it works. Helping you is actually helping me contribute back to the mingw-w64 project as a whole. Besides fixing those uuid's I'm working on adding some missing includes for OBS Studio that mingw-w64 is missing like wscapi and iwscapi as well as some mmdevapi speaker configs. So like I said, l'll deal with this, as it's a learning experience for me :)

@joankaradimov
Copy link
Contributor Author

@ZachBacon: What you are saying makes sense.

While getting more modules to compile, I encountered another missing symbol - IID_IHTMLOMWindowServices

@joankaradimov
Copy link
Contributor Author

... and some more: IID_IEmptyVolumeCacheCallBack, IID_IEmptyVolumeCache, IID_IEmptyVolumeCache2, FMTID_ImageSummaryInformation, FMTID_MediaFileSummaryInformation, FMTID_AudioSummaryInformation, CLSID_CTask, CLSID_CTaskScheduler, IID_IProvideTaskPage, IID_IScheduledWorkItem, IID_ITask, IID_ITaskScheduler, IID_ITaskTrigger.

There are a lot of those, it appears :/

@ZachBacon Maybe I should take over. I'll understand if you don't have the time to deal with all of these.

@ZachBacon
Copy link
Contributor

@joankaradimov You underestimate the amount of free time I have now adays. The sad benefits of leaving ones job and in the middle of looking for a new one. Nah, I got this. Though if you do want to help, I've forked the mingw-w64 repo at https://github.com/ZachBacon/mingw-w64 I'm occasionally syncing with upstream so that I can make the proper changes and send them signed off patches. I can give you commit access there, that way we can both work on it.

@joankaradimov
Copy link
Contributor Author

I can give you commit access there, that way we can both work on it.

No need. It's better to open PRs in your repo. This way you can review the changes.

Maybe I can start backwards alphabetically and do IID_ITask* stuff first.

@Alexpux
Copy link
Member

Alexpux commented Jul 22, 2019

Some GUIDS:

3050F5FC-98B5-11CF-BB82-00AA00BDCE0B IHTMLOMWindowServices
6E793361-73C6-11D0-8469-00AA00442901 IEmptyVolumeCacheCallBack
02B7E3BA-4DB3-11D2-B2D9-00C04F8EEC8C IEmptyVolumeCache2
8FCE5227-04DA-11D1-A004-00805F8ABE06 IEmptyVolumeCache
4086658A-CBBB-11CF-B604-00C04FD8D565 IProvideTaskPage
A6B952F0-A4B1-11D0-997D-00AA006887EC IScheduledWorkItem
148BD524-A2AB-11CE-B11F-00AA00530503 ITask
148BD527-A2AB-11CE-B11F-00AA00530503 ITaskScheduler
148BD52B-A2AB-11CE-B11F-00AA00530503 ITaskTrigger

@Alexpux
Copy link
Member

Alexpux commented Jul 22, 2019

in other form:

DEFINE_GUID(IID_IHTMLOMWindowServices, 0x3050F5FC, 0x98B5, 0x11CF, 0xBB, 0x82, 0, 0xAA, 0, 0xBD, 0xCE, 0xB);
DEFINE_GUID(IID_IEmptyVolumeCacheCallBack, 0x6E793361, 0x73C6, 0x11D0, 0x84, 0x69, 0, 0xAA, 0, 0x44, 0x29, 0x1);
DEFINE_GUID(IID_IEmptyVolumeCache2, 0x02B7E3BA, 0x4DB3, 0x11D2, 0xB2, 0xD9, 0, 0xC0, 0x4F, 0x8E, 0xEC, 0x8C);
DEFINE_GUID(IID_IEmptyVolumeCache, 0x8FCE5227, 0x04DA, 0x11D1, 0xA0, 0x4, 0, 0x80, 0x5F, 0x8A, 0xBE, 0x6);
DEFINE_GUID(IID_IProvideTaskPage, 0x4086658A, 0xCBBB, 0x11CF, 0xB6, 0x4, 0, 0xC0, 0x4F, 0xD8, 0xD5, 0x65);
DEFINE_GUID(IID_IScheduledWorkItem, 0xA6B952F0, 0xA4B1, 0x11D0, 0x99, 0x7D, 0, 0xAA, 0, 0x68, 0x87, 0xEC);
DEFINE_GUID(IID_ITask, 0x148BD524, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0, 0xAA, 0, 0x53, 0x5, 0x3);
DEFINE_GUID(IID_ITaskScheduler, 0x148BD527, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0, 0xAA, 0, 0x53, 0x5, 0x3);
DEFINE_GUID(IID_ITaskTrigger, 0x148BD52B, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0, 0xAA, 0, 0x53, 0x5, 0x3);

@smalltalkman
Copy link
Contributor

smalltalkman commented Jul 22, 2019

Not tested, but may be helpful:

DEFINE_GUID(CLSID_CTask, 0x148BD520, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03);
DEFINE_GUID(CLSID_CTaskScheduler, 0x148BD52A, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03);

from winsdk-10

// FMTID_ImageSummaryInformation
#define PSGUID_IMAGESUMMARYINFORMATION {0x6444048fL, 0x4c8b, 0x11d1, 0x8b, 0x70, 0x8, 0x00, 0x36, 0xb1, 0x1a, 0x03}
// FMTID_MediaFileSummaryInformation, see propidl.h PID_ values for this
#define PSGUID_MEDIAFILESUMMARYINFORMATION {0x64440492L, 0x4c8b, 0x11d1, 0x8b, 0x70, 0x08, 0x00, 0x36, 0xb1, 0x1a, 0x03}

from winsdk-10

FMTID_AudioSummaryInformation     : TGuid = '{64440490-4C8B-11D1-8B70-080036B11A03}';

from here

@ZachBacon
Copy link
Contributor

ZachBacon commented Jul 22, 2019

excellent, I'll get those in later tonight or tomorrow, if things test out well, I'll send in the patches as a unified patch to the mingw-w64 project as well.

What I'd like to do eventually, any problematic packages that won't compile due to something missing in mingw-w64 but compiles with msvc, I'd like to try and make patches to the mingw-w64 sdk, help expand the compatibility and expand what we can carry in the repository potentially.

@ZachBacon
Copy link
Contributor

Got the UUID's in, Gonna work on the FMTID_AudioSummaryInformation in next
https://github.com/ZachBacon/mingw-w64/commit/d9fa05738de7de26147e460c29ac80b088422799.patch

@ZachBacon
Copy link
Contributor

Apologies for delays, other things kinda took my attention. I'll submit a PR soon regarding the missing uuid's

@joankaradimov
Copy link
Contributor Author

Apologies for delays, other things kinda took my attention.

No problem. Thank you for getting involved in this!

I'll submit a PR soon regarding the missing uuid's

Could you review my PR in your repo and potentially squash it into you changes?

@ZachBacon
Copy link
Contributor

yeah I could do that.

@ZachBacon
Copy link
Contributor

And patches sent to the mingw-w64-public mailing lists

@ZachBacon
Copy link
Contributor

ZachBacon commented Aug 22, 2019

Sometime this week, I'm going to attempt to make a PR for the patches we made for the headers/crt packages, due to the fact they are now pushed to the mailing list for mingw-w64, and this should now allow the pywin32 package to be compiled for msys2

@ZachBacon
Copy link
Contributor

And got confirmation, the patches got applied upstream.

@joankaradimov
Copy link
Contributor Author

They have also landed in MSYS2 with commit 8146fdb. This is fixed. I'm closing the issue.

Thanks, @ZachBacon, and thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants