Search
Tuesday, 6th of April 2021, 20:22:22 UTC
20:51:06
drmeister
Someone on the #llvm discord answered my question about this - these are probably inlined methods.
20:51:34
drmeister
So the compiler generates a function when I ask for the pointer - but it doesn't have a real address.
20:51:40
drmeister
I'll have to write wrappers for these.
21:06:41
drmeister
Hmmm, on macOS this isn't a problem - I can identify symbols with dladdr for everything.
21:08:45
Bike
guess it optimizes differently
21:13:10
Bike
today i realized tagbody SJLJ unwinds have been broken for six months, which i guess goes to show how rare those are
21:14:23
drmeister
What should I do about this? The obvious, bullet-proof thing I can do is write functions wrappers that take the object and arguments and do nothing but call the method and return the result.
21:14:30
drmeister
Good on the SJLJ fix.
21:14:59
Bike
this is for restoring the image, right? these are pointers that already exist before the image dump?
21:15:25
drmeister
Yes - for restoring the image and yes - the pointers already exist before the image dump.
21:15:38
Bike
so how do we have pointers to these things if these things do not in fact have addresses?
21:16:05
Bike
ODR is going to be involved here somehow, i just know it
21:16:58
drmeister
That's a mystery that I have only in the last few minutes become aware of. I believe that on linux a method is instantiated by the compiler - but it doesn't get an address/symbol that dladdr/dlsym can resolve?
21:17:31
drmeister
ACTION pulls up the reference to read about ODR.
21:18:43
Bike
i mean, basically, so it's not in the SO, but when we include the header we need an actual pointer so the compiler instantiates one
21:19:14
drmeister
I'm going to start writing wrapper functions. It's the only thing I am certain will solve this problem.
21:20:20
drmeister
I have 53 of them to deal with.
21:20:21
drmeister
https://www.irccloud.com/pastebin/yfCzwGlb/
21:20:50
Bike
does that mean we're going to have to use the wrappers pervasively
21:20:58
Bike
or i guess if we just call our own llvm-sys functions anyway it's ok
21:21:17
drmeister
I put a function to call dladdr on every function/method we expose when we startup clasp the old way.
21:22:07
drmeister
I'll write one and that will show us both what is involved...
21:22:09
Bike
i mean are we going to hvae to change cmpir.lsp and stuff
21:22:38
drmeister
Nonononono - I'll expose the function with the same name as we currently use.
21:23:19
drmeister
https://github.com/clasp-developers/clasp/blob/future/src/llvmo/llvmoExpose.cc#L1378
21:24:38
drmeister
That generates a wrapper for this...
21:24:38
drmeister
https://github.com/clasp-developers/clasp/blob/future/src/llvmo/llvmoExpose.cc#L1378
21:25:23
drmeister
https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/Module.h#L300
21:25:49
drmeister
And clearly - that is a candidate for inlining.
21:27:49
drmeister
But I gotta look up EVERY ONE of these functions and write a wrapper for it. Bleh.
21:28:14
drmeister
I'm trying this right now...
21:28:15
drmeister
https://www.irccloud.com/pastebin/3tJKVHma/
21:30:23
drmeister
Oh glob - and when you add a function - pretty much everything needs to be recompiled.
21:32:06
drmeister
Oh well - it's a clear path to the goal.
21:35:11
drmeister
I'll do ten at a time and then fix compile-time bugs
21:35:15
drmeister
https://www.irccloud.com/pastebin/oDClNWTM/
21:40:53
drmeister
Alright - then I have 52 problems.
21:40:56
drmeister
https://www.irccloud.com/pastebin/XKQLJXxT/
3:04:21
beach
Good morning everyone!
Wednesday, 7th of April 2021, 8:22:22 UTC