That's why you only rebase when you actually need to in such cases. Another trick is to keep as few touch points into the original code as possible, preferring to keep most custom code in custom files.
There are software tools like quilt, who do exactly that.