Fix handling of --build-id
Use Trevor's fix for --build-id.