Closed Bug 1568634 Opened 1 year ago Closed 5 months ago

Need specific order in generated OS_LIBS

Categories

(Firefox Build System :: General, enhancement, P1)

Unspecified
Windows
enhancement

Tracking

(firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: aklotz, Assigned: aklotz)

References

Details

Attachments

(1 file)

I have problem:

The launcher process needs to call RtlCaptureStackBackTrace which is exported from ntdll.dll. Unfortunately, the same function is also exported from kernel32.dll but forwards to the implementation in ntdll.dll.

Unfortunately the build system is linking the kernel32 variant of RtlCaptureStackBackTrace into firefox.exe instead of the ntdll variant.

I cannot use the kernel32.dll version because the code in question is running before kernel32.dll has even been linked into the process.

With the MSVC linker, order is important, so if we were to specify ntdll.lib ahead of kernel32.lib, the linker would use the former.

I don't know whether lld honors this or not. If so, then I need a way to be able to tell the build system that ntdll.lib must be the first entry in OS_LIBS (or at least must appear ahead of kernel32.lib).

If not, I need to find some other way to tell the linker that RtlCaptureStackBackTrace must come from ntdll.lib and not kernel32.lib

Thanks to dmajor's hint on IRC, I have a working fix.

Assignee: nobody → aklotz
Status: NEW → ASSIGNED
Priority: -- → P1

Since kernel32.lib is a defaultlib we do not need to explicitly include it
in the OS_LIBS list; the linker will implicitly added it to the end of the list.
In fact, its presence interferes with other explicitly added .lib files that
should take precedence.

Pushed by aklotz@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/753859ba84c2
Remove kernel32.lib from LIBS in old-configure.in; r=glandium
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.