Skip to content

regression: PCH with msvc causing "error LNK2011: precompiled object not linked in; image may not run" #10745

@anarazel

Description

@anarazel

Hi,

As mentioned on IRC: Starting with @dcbaker 's c94c492 I see msvc builds of postgres fail when pch is enabled:

[56/56] Linking target src/bin/pg_config/pg_config.exe
FAILED: src/bin/pg_config/pg_config.exe src/bin/pg_config/pg_config.pdb
"link"  /MACHINE:x64 /OUT:src/bin/pg_config/pg_config.exe src/bin/pg_config/pg_config.exe.p/pg_config.c.obj "/nologo" "/release" "/nologo" "/DEBUG" "/PDB:src\bin\pg_config\pg_config.pdb" "src/common\libpgcommon.a" "src/fe_utils\libpgfeutils.a" "src/port\libpgport.a" "ws2_32.lib" "ws2_32.lib" "ws2_32.lib" "ws2_32.lib" "/SUBSYSTEM:CONSOLE" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib" "advapi32.lib"
libpgcommon.a(config_info.c.obj) : error LNK2011: precompiled object not linked in; image may not run
  Hint on symbols that are defined and could potentially match:
    __@@_PchSym_@00@UwveUklhgtivhRnvhlmUyfrowRmrmqzUhixUkligUoryktkligOzOkUxPkxsOlyq@pgport_main
    __@@_PchSym_@00@UwveUklhgtivhRnvhlmUyfrowRmrmqzUhixUxlnnlmUoryktxlnnlmOzOkUxPkxsOlyq@pgcommon

The @pgport_main etc is the result of me going through the static libraries and naming them with /Yl<somename> as part of trying to debug this.

I spent a decent bit of time trying to build a reproducer, but I'm getting too tired. I suspect it's related to a static library that links to another static library. But it doesn't trigger in a simplistic reproducer unfortunately.

Regards,

Andres

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions