@@ -1734,6 +1734,9 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
1734
1734
1735
1735
if (auto *arg = args.getLastArg (OPT_pdb_source_path))
1736
1736
config->pdbSourcePath = arg->getValue ();
1737
+
1738
+ if (args.hasArg (OPT_fullpdbpath))
1739
+ config->enableFullPdbPath = true ;
1737
1740
}
1738
1741
1739
1742
// Handle /pdbstripped
@@ -2345,16 +2348,18 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
2345
2348
// The embedded PDB path should be the absolute path to the PDB if no
2346
2349
// /pdbaltpath flag was passed.
2347
2350
if (config->pdbAltPath .empty ()) {
2348
- // config->pdbAltPath = config->pdbPath;
2349
-
2350
- // It's important to make the path absolute and remove dots. This path
2351
- // will eventually be written into the PE header, and certain Microsoft
2352
- // tools won't work correctly if these assumptions are not held.
2353
- // sys::fs::make_absolute(config->pdbAltPath);
2354
- // sys::path::remove_dots(config->pdbAltPath);
2355
- // This way below can hide our pdb path.
2356
- config->pdbAltPath =
2357
- sys::path::filename (config->pdbPath , sys::path::Style ::windows);
2351
+ if (config->enableFullPdbPath ) {
2352
+ config->pdbAltPath = config->pdbPath ;
2353
+ // It's important to make the path absolute and remove dots. This path
2354
+ // will eventually be written into the PE header, and certain Microsoft
2355
+ // tools won't work correctly if these assumptions are not held.
2356
+ sys::fs::make_absolute (config->pdbAltPath );
2357
+ sys::path::remove_dots (config->pdbAltPath );
2358
+ } else {
2359
+ // This way below can hide our pdb path.
2360
+ config->pdbAltPath =
2361
+ sys::path::filename (config->pdbPath , sys::path::Style ::windows);
2362
+ }
2358
2363
} else {
2359
2364
// Don't do this earlier, so that ctx.OutputFile is ready.
2360
2365
parsePDBAltPath ();
0 commit comments