Drugmaker AbbVie said it will buy Pharmacyclics for about $21 billion to boost its oncology drugs pipeline.