Link with debug or opt build depending on profile code in benchmark.