Archive 17/01/2023.

Update SDL 2.0.12

glebedev

I’ve started a branch to update SDL from 2.0.10 to 2.0.12 as hdiapi gamepad support in 2.0.10 is awful.

It doesn’t even compile on windows yet. Any help is welcome.

weitjong

I could have a look but not after I wrap up a few other things in the dev branch I am currently working on. But I will most probably start a new instead of fixing on top of yours.

glebedev

Shall I abandon this one then?

weitjong

If you still want to try to get it work then no harm to keep the PR there first. I actually haven’t looked at it though. Who knows it is just a simple mistake.

glebedev

I suspect the problem is in cmake file.

If you going to do it yourself in next couple weeks I can wait. Otherwise I’ll try to make it work.

weitjong

We are using heavily modified CMake build scripts. For sure you cannot just simply replace that with the original but upgraded scripts from SDL and expect it to work.

glebedev

I didn’t replace it, I kept the one that was in Urho. Although it is hard to track what is different there since it is very different from original SDL 2.0.10 cmake.

glebedev

My question is if you have a SDL upgrade timeline on mind or it may happen “some time in future”.

weitjong

I know exactly what you are saying. Believe me. Over the years, I have come up with my own way to keep track of the local as well as the upstream changes and able to “systematically” merge the changes together. However, it is still rather a convoluted process using git and vi to resolve any conflicts. Not easy for me to elaborate here, although I have written the gist of it in my personal github account. It was a mental notes for myself and I don’t expect anyone else to read and understand from it.

I don’t have a specific timeline for it. Actually I have another bigger fish to fry in my current dev branch.

glebedev

Ok, then I’ll try to make it work myself.

glebedev

Btw do you know how to switch joystick support from hid to xinput or xinput? This would also work for me fine.

Modanung

7 posts were split to a new topic: Return of the nag

weitjong

I am also not the expert of SDL. I just know one thing or two on how to get the upstream changes merge into the Urho3D from earlier experience through trial and error. Practice makes perfect, they say. However, in actual fact, for each upgrade I have to spend a lot of time and energy to reconcile the conflict, but I am not as fit anymore. I just have a systematical way to identify the changes (thanks to Git), but the hard labor is in conflict resolution. In other words, whether you and I have the systematic way for performing the upgrade or not, we both will face the same daunting task. And, no, I don’t know the answer to your last question.

weitjong

What happened to 2.0.11? They just jumped from 2.0.10 to 2.0.12?

glebedev

Looks like it… I don’t know why.

I also wonder if they going to produce 2.0.13 in the middle of the merge… That would be unfortunate :slight_smile:

glebedev

May I ask you where SDL_EXPORTS is defined? I can’t find it in cmake files…

glebedev

It is used there but I can’t find where it is defined…

// Urho3D: Only export when it is being requested
#ifdef SDL_EXPORTS
weitjong

I think it is basically just a way to make it not exported. Urho3D builds all its sub-libraries as STATIC.

glebedev

Samples reference Urho3D. Urho3D reference SDL. Sample compilation fails because of missing SDL functions like SDL_free.

Any ideas why it would be?

weitjong

You meant building “Urho3D” lib itself is fine? And only failed in samples?

glebedev

Exactly.

And now few words to make reply longer than 20 chars.

weitjong

It means the symbol is eliminated in the final Urho3d lib, but that’s not correct. It’s hard to guess the root cause though. Ensure you are using STATIC lib type for SDL. Check the generated SDL config file is identical to previous one before upgrade, or at least it should be similar and diffs are acceptable.

I suppose you are using SHARED lib type for Urho3D lib itself?

weitjong

Also you have to use the same Urho3D-specific macro to add/setup the SDL lib. You cannot use the CMake command as per original build script from SDL. In the background our macro does a number of heavy lifting. One of the task is to mark which archive containing the *.obj should be used in building the final engine lib.

glebedev

I’m not using SDL cmake script. I moved all changes to 2.0.12 I could move to the existing Urho3D SDL file.

I’m running cmake script for vs2019 from scripts folder with default settings, so whatever is by default…

weitjong

By that you should be using STATIC lib type for the engine too. The STATIC lib type is just an archive of all *.obj from Urho3D and all its sub-libs including SDL. So there is no reason for the downstream using the final lib to have missing symbol, unless the symbol is not there in the first place. Can you check the archive from SDL to see if it still has SDL_free? In Linux the archive file is the *.a. Not sure on Windows, *.lib perhaps. In Linux we use “nm” command to check the content of the archive file. Again, not sure on Windows.

weitjong

Perhaps you should try to use SHARED lib type for the Urho3D lib. This way it should be linked against the SDL lib, so if you have issue with SDL then the problem should hopefully show up while building the engine lib.

glebedev

Section length 9AA, #relocs 6A, #linenums 0, checksum 5E719D6B
00F 00000000 UNDEF notype () External | SDL_free

With the new SDL build:
00C 00000000 UNDEF notype () External | SDL_free_REAL

Wtf is that _REAL part?

glebedev

So it seems dynapi wasn’t disabled properly?

glebedev

@weitjong ok, I’ve missed a change in dynapi header.

Looking into .lib was a good idea, thanks!

glebedev

Well, it’s a start!

glebedev

Also my xbox controller works now. So it wasn’t for nothing.I have around 10 files to merge and then it should be ready for review.

Modanung

@glebedev You must know, it’s good to see you working on Urho proper. :slight_smile:

glebedev

I guess I didn’t break the LSEEK, right? https://github.com/urho3d/Urho3D/pull/2706/checks?check_run_id=1326432936

weitjong

No, you didn’t. I have explained it to you separately in the PR.

Pencheff

I’m also trying to update, SDL 2.0.22, some builds are failing:

Suggestions are welcome